Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SRWebClient.POST("url")
- .data(imageData, fieldName:"imagefile", data: ["username":self.username,"key":self.token])
- .send({(response:AnyObject!, status:Int) -> Void in
- if let json: NSDictionary = NSJSONSerialization.JSONObjectWithData(response, options: NSJSONReadingOptions.MutableContainers, error: nil) as! NSDictionary
- {
- if let status = json["status"] as? Int
- {
- println("Received status \(status)")
- } else { println("Fail to retrive status")
- if let picture = json["picture"] as? String
- {
- println("Received status \(status)")
- } else { println("Fail to retrive picture")
- }}}
- },failure:{(error:NSError!) -> Void in
- // process failure response
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement