XMNetworking
XMNetworking copied to clipboard
how to set acceptableContentTypes?
how i can set acceptableContentTypes .when the response data is not json?
error info:
Error Domain=com.alamofire.error.serialization.response Code=-1016 "Request failed: unacceptable content-type: text/html" UserInfo={NSLocalizedDescription=Request failed: unacceptable content-type: text/html, NSErrorFailingURLKey=
i use my way to deal with this problem.
open the file XMEngine.m.In line 495 ,cancel this annotation .
_afJSONResponseSerializer.acceptableContentTypes = [NSSet setWithObjects:@"application/json", @"text/json",
@"text/javascript", @"text/html", @"text/plain", nil];
it's a stupid way to deal.looking forward to the author to deal with it.thx
[[XMEngine sharedEngine].sessionManager.requestSerializer setValue:@"whatyouwanttomodify" forHttpHeaderField:@"Content-Type"];