Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

erdinc27

macrumors regular
Original poster
Jul 20, 2011
168
1
First time I use AFNetworking in a project. I am facing such a problem. I test the service in postman and it returns success but when I send request over XCode with the same parameters then I get such an error
Error Domain=AFNetworkingErrorDomain Code=-1011 "Request failed: internal server error (500)
What could be reason for that?
 
The error is not from AFNetworking as such but from the server. The server is telling you that the request failed with an error code '500'. This is a very generic catchall error.

You will have to compare the request you make in your app with the one from postman. Particularly headers. Do you perhaps need to set to accept JSON?

Easiest way to compare is to use Charles proxy to spot the differences.
 
The error is not from AFNetworking as such but from the server. The server is telling you that the request failed with an error code '500'. This is a very generic catchall error.

You will have to compare the request you make in your app with the one from postman. Particularly headers. Do you perhaps need to set to accept JSON?

Easiest way to compare is to use Charles proxy to spot the differences.
Thanks for the reply. The weird thing is that those services worked two days ago without any problem but now all services are responding that error. When I send request with NSURLSession then I can get proper response but not with AFNetworking. That is why I thought it is a problem with AFNetworking
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.