I am using AFNetwoking
, AFHTTPClient
object to hit a REST API with verb PUT.
What I get in response is: status 500 along with the custom status message in response header field s in status code field.
Response header field: Status Code: 500 Please check you van number and try again.
Basically the issue is to parse this status message. Here is the code:
NSHTTPURLResponse *response;
NSMutableURLRequest *request = [httpClient requestWithMethod:PUT_CALL path:requestUrl parameters:params];
NSData *data = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error];
response object has no getter to get this status message. When I tried to get all response header fields, I get all the key value pairs except the status code field in which message is also coming.