I am using the following code to post an image to my server.
@IBAction func postButtonPressed(sender: UIButton) { let task = NSURLSession.sharedSession(
I fixed using headers with application/json and sending on the request:
let headers: HTTPHeaders = [ .accept("application/json") ] AF.request(url, method: .post, parameters: score, encoder: JSONParameterEncoder.default, headers: headers)