Advertisement
Guest User

Untitled

a guest
May 28th, 2015
255
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. SRWebClient.POST("url")
  2. .data(imageData, fieldName:"imagefile", data: ["username":self.username,"key":self.token])
  3. .send({(response:AnyObject!, status:Int) -> Void in
  4.  
  5.  
  6. if let json: NSDictionary = NSJSONSerialization.JSONObjectWithData(response, options: NSJSONReadingOptions.MutableContainers, error: nil) as! NSDictionary
  7. {
  8. if let status = json["status"] as? Int
  9. {
  10. println("Received status \(status)")
  11. } else { println("Fail to retrive status")
  12.  
  13. if let picture = json["picture"] as? String
  14. {
  15. println("Received status \(status)")
  16. } else { println("Fail to retrive picture")
  17. }}}
  18.  
  19.  
  20.  
  21. },failure:{(error:NSError!) -> Void in
  22. // process failure response
  23. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement