I want to send a POST
request with Alamofire SessionManager
.
I read the documentation on https://github.com/Alamofire/Alamofire/blob/maste
You need conform URLRequest
with your parameters in body as Data
This code can help you
var request = URLRequest(url: urlString!)
request.httpMethod = "POST"
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
request.httpBody = try! JSONSerialization.data(withJSONObject: parameters)
manager.request(request)
.responseJSON { response in
fulfill(response)
}
Hope this helps