AF请求错误3840、1011、500状态码

遇到这个问题,搞了两个小时,实在忍不住怼了后台,发现后台把请求URL改了!

收到响应: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., NSUnderlyingError=0x60400024d080 {Error Domain=com.alamofire.error.serialization.response Code=-1011 "Request failed: internal server error (500)" UserInfo={NSLocalizedDescription=Request failed: internal server error (500), NSErrorFailingURLKey=http://192.168.1.201:61/appapi?, com.alamofire.serialization.response.error.data=<3c21444f 43545950 45206874 6d6c2050 55424c49 4320222d 2f2f5733 432f2f44 54442048 544d4c20 342e3031 20547261 6e736974 696f6e61 6c2f2f45 4e222022 68747470 3a2f2f77 77772e77 332e6f72 672f5452 2f68746d 6c342f6c 6f6f7365 2e647464 223e0d0a 3c68746d 6c3e0d0a 3c686561 643e0d0a 3c6d6574 61206874 74702d65 71756976 3d22436f 6e74656e 742d5479 70652220 636f6e74 656e743d 22746578 742f6874 6d6c3b20 63686172 7365743d 5554462d 38223e0d 0a3c6d65 7461206e 616d653d 22766965 77706f72 74222063 6f6e7465 6e743d22 77696474 683d6465 76696365 2d776964 74682c20 696e6974 69616c2d 7363616c 653d312c 206d6178 696d756d 2d736361 6c653d31 223e0d0a 3c746974 6c653e9f 3c2f7469 746c653e 0d0a3c2f 68656164 3e0d0a3c 626f6479 3e0d0a3c 64697620 7374796c 653d2277 69647468 3a313030 25223e3c 696d6720 20737263 3d222f73 74617469 632f696d 61676573 2f343034 2e706e67 22202077 69647468 3d223130 30252220 616c743d 2222202f 3e3c2f64 69763e0d 0a3c2f62 6f64793e 0d0a3c2f 68746d6c 3e>, com.alamofire.serialization.response.error.response= { URL: http://192.168.1.201:61/appapi? } { Status Code: 500, Headers {
    Date = (
    Tue, 11 Dec 2018 01:13:07 GMT,
);
    Connection = (
    close,
);
    Content-Type = (
    text/html;charset=ISO-8859-1,
);
    Content-Length = (
    417,
);
    Server = (
    Apache-Coyote/1.1,
);
    Set-Cookie = (
    JSESSIONID=CFCE85921D6A93ABFF5026DDC9A50112; Path=/; HttpOnly,
);
}
 }}}}
{
    NSDebugDescription = JSON text did not start with array or object and option to allow fragments not set.;
    NSUnderlyingError = Error Domain=com.alamofire.error.serialization.response Code=-1011 "Request failed: internal server error (500)" UserInfo={NSLocalizedDescription=Request failed: internal server error (500), NSErrorFailingURLKey=http://192.168.1.201:61/appapi?, com.alamofire.serialization.response.error.data=<3c21444f 43545950 45206874 6d6c2050 55424c49 4320222d 2f2f5733 432f2f44 54442048 544d4c20 342e3031 20547261 6e736974 696f6e61 6c2f2f45 4e222022 68747470 3a2f2f77 77772e77 332e6f72 672f5452 2f68746d 6c342f6c 6f6f7365 2e647464 223e0d0a 3c68746d 6c3e0d0a 3c686561 643e0d0a 3c6d6574 61206874 74702d65 71756976 3d22436f 6e74656e 742d5479 70652220 636f6e74 656e743d 22746578 742f6874 6d6c3b20 63686172 7365743d 5554462d 38223e0d 0a3c6d65 7461206e 616d653d 22766965 77706f72 74222063 6f6e7465 6e743d22 77696474 683d6465 76696365 2d776964 74682c20 696e6974 69616c2d 7363616c 653d312c 206d6178 696d756d 2d736361 6c653d31 223e0d0a 3c746974 6c653e9f 3c2f7469 746c653e 0d0a3c2f 68656164 3e0d0a3c 626f6479 3e0d0a3c 64697620 7374796c 653d2277 69647468 3a313030 25223e3c 696d6720 20737263 3d222f73 74617469 632f696d 61676573 2f343034 2e706e67 22202077 69647468 3d223130 30252220 616c743d 2222202f 3e3c2f64 69763e0d 0a3c2f62 6f64793e 0d0a3c2f 68746d6c 3e>, com.alamofire.serialization.response.error.response= { URL: http://192.168.1.201:61/appapi? } { Status Code: 500, Headers {
    Date = (
    Tue, 11 Dec 2018 01:13:07 GMT,
);
    Connection = (
    close,
);
    Content-Type = (
    text/html;charset=ISO-8859-1,
);
    Content-Length = (
    417,
);
    Server = (
    Apache-Coyote/1.1,
);
    Set-Cookie = (
    JSESSIONID=CFCE85921D6A93ABFF5026DDC9A50112; Path=/; HttpOnly,
);
}
 }};
}

你可能感兴趣的:(AF请求错误3840、1011、500状态码)