Alamofire 5 (Beta 6): Parameters of PUT Request do not arrive in Flask-Restful Alamofire 5 (Beta 6): Parameters of PUT Request do not arrive in Flask-Restful flask flask

Alamofire 5 (Beta 6): Parameters of PUT Request do not arrive in Flask-Restful


I am currently using the same version AlamoFire, and when I use the PUT method, I use it as follows:

let request = AF.request(url, method: .put, parameters: ["uid": uid],                         encoding: JSONEncoding.default, headers: headers)request.responseJSON(completionHandler: { response in     guard response.error == nil else {        //Handle error    }    if let json = response.value as? [String: Any]    // Handle result.}

The only difference to your post is that I used the encoding option. You can try to put the option and see what happens.


It looks like your server is expecting your PUT parameters to be URL form encoded into the URL. You may be hitting the version of the request method that uses JSON encoding by default, so adding encoder: URLEncodedFormParameterEncoder.default at the end of your request call should fix that. A future release will make that the default, as it's safe across all request types.

If that's not the issue, I suggest you investigate more closely to see what the differences between the requests may be. Since you control the server you should have easy access to the traffic.