Error Domain=NSCocoaErrorDomain Code=3840 "JSON text did not start with array or object and option t
2017-07-04 16:58
3031 查看
开发中进行数据请求时候报了这个错误
这是因为AFN网络请求返回数据格式为json,提示这个错误是因为返回数据非json格式。
解决办法:
首先检查一下网络请求方法中是否有这句代码
如果没有添加上就可解决
如果有这句代码,那就是后台给你返回数据的问题了,让后台改一下。
这是因为AFN网络请求返回数据格式为json,提示这个错误是因为返回数据非json格式。
解决办法:
首先检查一下网络请求方法中是否有这句代码
//设置返回数据格式为JSON manager.responseSerializer = [AFHTTPResponseSerializer serializer];
如果没有添加上就可解决
如果有这句代码,那就是后台给你返回数据的问题了,让后台改一下。
相关文章推荐
- Error Domain=NSCocoaErrorDomain Code=3840 "JSON text did not start with array or object and option t
- Error Domain=NSCocoaErrorDomain Code=3840 "JSON text did not start with array or object and option
- AFNetworking 关于JSON text did not start with array or object and option to allow fragments not set 错误
- AFNetworking 关于JSON text did not start with array or object and option to allow fragments not set 错误
- AFNetworking 报错 JSON text did not start with array or object and option to allow fragments not set
- error:Error Domain=NSCocoaErrorDomain Code=3840 "JSON text did not start with array or object and op
- iOS开发 AFNetworking 关于JSON text did not start with array or object and option to allow fragments not
- AFNetworking 关于JSON text did not start with array or object and option to allow fragments not set
- iOS开发Post请求错误:Error Domain=NSCocoaErrorDomain Code=3840 "JSON text did not start with array or ...
- Exception in thread "main" net.sf.json.JSONException: A JSONArray text must start with '[' at charac
- tomcat 7 WARNING: A context path must either be an empty string or start with a '/' and do not end with a '/'. The path [/] does not meet these criteria and has been changed to []
- MSBuild could not create or connect to a task host with runtime "CLR2" and architecture "x86".
- javascript: Jquery each loop with json array or object
- json 解析 A JSONArray text must start with '['
- javascript: Jquery each loop with json array or object
- The Contents.json describing the image set "BG_Email_Textfield.imageset" must start with a top level
- javascript: Jquery each loop with json array or object
- A context path must either be an empty string or start with a '/' and do not end with a '/' 问题解决方法
- 从 "specified with /SECTION option does not exist" 说开
- fatal error C1047: The object or library file "..."was created with an older compiler than other obj