您当前的位置: 首页 >  ar

培根芝士

暂无认证

  • 1浏览

    0关注

    446博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

AFNetworking 报错JSON text did not start with array or object and option to allow fragments not set…

培根芝士 发布时间:2021-01-18 18:10:13 ,浏览量:1

AFNetworking默认把响应结果当成JSON来处理

manager.responseSerializer = [AFJSONResponseSerializer serializer]

如果返回的并不是一个JSON,而是一个html网页,AFNetworking就会报这个错误

解决方案:

将responseSerializer改为[AFHTTPResponseSerializer serializer];

 manager.responseSerializer = [AFHTTPResponseSerializer serializer];
关注
打赏
1660824269
查看更多评论
立即登录/注册

微信扫码登录

0.0368s