SHARE
TWEET

Untitled

a guest Jan 12th, 2017 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. let URL = Foundation.URL(string: "http:....")!
  2. let mutableURLRequest = NSMutableURLRequest(url: URL)
  3. mutableURLRequest.httpMethod = "POST"
  4.  
  5. let parameters = ["UserName": "Teste"]
  6.   do{
  7.     mutableURLRequest.httpBody = try JSONSerialization.data(withJSONObject: parameters, options: JSONSerialization.WritingOptions())
  8.     }catch{}
  9.  
  10. mutableURLRequest.setValue("application/json", forHTTPHeaderField: "Content-Type")
  11.  
  12. Alamofire.request("https").responseJSON{response in....}
RAW Paste Data
Top