美文网首页
JSON text did not start with arr

JSON text did not start with arr

作者: CaptainSirZero | 来源:发表于2017-08-11 11:00 被阅读979次

请求数据时报错:

error: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.}

原因:

未指定响应接收类型

解决办法:

  1. 指定响应接收类型
    [AFHTTPSessionManager new].requestSerializer = [AFHTTPRequestSerializer serializer];
    [AFHTTPSessionManager new].responseSerializer = [AFHTTPResponseSerializer serializer];

2.修改接收响应类型,设置的过多,导致错误了

相关文章

网友评论

      本文标题:JSON text did not start with arr

      本文链接:https://www.haomeiwen.com/subject/zmjlrxtx.html