iOS AFN Code=3840

iOS AFN Code=3840

BUG

Error Domain=NSCocoaErrorDomain Code=3840 "JSON text did not start with array or object and option to allow fragments not set." UserInfo={NSDebugDescription=JSON text did not start with array or object and option to allow fragments not set.}

解决办法

AFHTTPSessionManager *mgr =[AFHTTPSessionManager manager];

AFSecurityPolicy *secur = [[AFSecurityPolicy alloc] init];
[secur setAllowInvalidCertificates:YES];
[mgr setSecurityPolicy:secur];
mgr.responseSerializer = [AFHTTPResponseSerializer serializer];

你可能感兴趣的:(iOS AFN Code=3840)