I am using the AFNetworking
framework to make several JSON web request.
During development if I fail to provide a required parameters or the Service developers have broken something :-) i receive a 500 error
The Error block of AFJSONRequestOperation
is correctly catching it. However i cannot see the page body because AfNetworking
is cancelling the request as soon as the error code in the head is received.
Is there some work around. I would like to spit out the response body to the log.
Use the
responseData
orresponseString
property from the operation that's passed into the failure block.You'll need to add the http Code 500 to the acceptable status codes and filter it on the success callback. There you will have a responseObject.