Advertisement
Guest User

Untitled

a guest
Sep 30th, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. let myMoment = <Authorized Moment from above>
  2.  
  3. // Access the data of a Website Moment
  4. let urlString = "\(myMoment.launchURL)/WebsiteBits?alllocales=true"
  5. let momentRequest = NSMutableURLRequest(URL: NSURL(string: urlString)!)
  6.  
  7. // You can use NSURLSession and dataTaskWithRequest(...), but we strongly encourage you to adopt the Requestable paradigm as discussed in "Getting Started -> Fundamentals"
  8. let task = NSURLSession.sharedSession().dataTaskWithRequest(momentRequest) { (data, response, error) in
  9. guard let data = data else {
  10. return // No data available!
  11. }
  12. // success - deserialize JSON
  13. }
  14. task.resume()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement