Guest User

Untitled

a guest
May 27th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. use "debug"
  2. use "json"
  3.  
  4. actor Main
  5.  
  6. new create(env: Env) =>
  7.  
  8. try
  9. let jsonDoc = (recover ref JsonDoc end).>parse("{ \"userName\": \"hello\" }")?
  10. Debug(jsonDoc.string())
  11. let userName = (jsonDoc.data as JsonObject).data("userName")? as String
  12. Debug(userName)
  13. else
  14. Debug("error")
  15. end
Add Comment
Please, Sign In to add comment