您好,欢迎来到知库网。
搜索
您的当前位置:首页JSON text did not start with arr

JSON text did not start with arr

来源:知库网

请求数据时报错:

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.修改接收响应类型,设置的过多,导致错误了

Copyright © 2019- zicool.com 版权所有 湘ICP备2023022495号-2

违法及侵权请联系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务