Guest User

Untitled

a guest
May 27th, 2018
88
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 val JsonDoc.>parse("{ \"userName\": \"hello\" }")? end
  10. Debug(jsonDoc.string())
  11. let userName = (jsonDoc.data as JsonObject val).data("userName")? as String
  12. Debug(userName)
  13. else
  14. Debug("error")
  15. end
Add Comment
Please, Sign In to add comment