I have the same problem, and the reason is that the API requires the GET http method, and I need to pass the parameter, I send it with the following code:
[request setHTTPBody:[postString dataUsingEncoding:NSUTF8StringEncoding]];
When I execute a request using the GET method, it will report an error.
My solution is when the API needs a GET , the parameter should add a URL, for example http://apiserver/api?paramName=paramValue , when the API method is POST , then use the code above, set HTTPBody for the request object.
source share