is there a way to ignore the return content type from a Rest Service for a AFJSONRequestOperation ? One of the services i use returns application/text and will not be fixed before the next major release. At the moment i use AFJSONRequestOperation and it fails because of this.
I tried to use:
AFHTTPClient *afClient = [[AFHTTPClient alloc] initWithBaseURL:url];
[afClient setDefaultHeader:@"Accept" value:@"application/json"];
But this do not work.
Any other way ?
Thanks,
Oliver
One possible solution for dealing with situations like this is calling
addAcceptableContentTypes:on theAFHTTPRequestOperationsubclass that you are using. In your specific situation, add the following snippet to theinitWithBaseURLmethod of yourAFHTTPClientsubclass.You can read more about
addAcceptableContentTypes:in the documentation of AFNetworking.