0

when passing header and params: Alamofire.AFError.URLRequestValidationFailureReason.bodyDataInGETRequest(0 bytes)

 AF.request(urlString,method:.get, parameters: parameters, encoding: URLEncoding.httpBody, headers: headers).responseJSON { response in

              print(response)

 }
LeNI
  • 1,184
  • 2
  • 10
  • 19

1 Answers1

1

As of Apple's 2019 OS versions, trying to make a GET request with body data will fail with an error. The value must be nil. Alamofire provides it's own error here in order to provide a consistent experience for Alamofire users, regardless of which OS their code is running on.

Jon Shier
  • 12,200
  • 3
  • 35
  • 37