Request Failed with Error: Error Domain=AFNetworkingErrorDomain Code=-1016 "Expected content type {(
"text/javascript",
"application/json",
"text/json"
)}, got text/html" UserInfo=0x7fe649fbd240 {NSLocalizedRecoverySuggestion={"code":510,"message":"\u77ed\u4fe1\u53d1\u9001\u5931\u8d25","token":""}, NSErrorFailingURLKey=http://192.168.1.10/ebi/index.php/c_user/create_code, AFNetworkingOperationFailingURLRequestErrorKey=<NSMutableURLRequest: 0x7fe649c7e640>
解决方案:
修改
[httpClient setDefaultHeader:@"Accept" value:@"text/json"];
在代码中加入
[AFJSONRequestOperation addAcceptableContentTypes:[NSSet setWithObject:@"text/html"]];
是我亲自尝试过的,希望能解决你的问题!