Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let URL = Foundation.URL(string: "http:....")!
- let mutableURLRequest = NSMutableURLRequest(url: URL)
- mutableURLRequest.httpMethod = "POST"
- let parameters = ["UserName": "Teste"]
- do{
- mutableURLRequest.httpBody = try JSONSerialization.data(withJSONObject: parameters, options: JSONSerialization.WritingOptions())
- }catch{}
- mutableURLRequest.setValue("application/json", forHTTPHeaderField: "Content-Type")
- Alamofire.request("https").responseJSON{response in....}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement