Error Domain=com.alamofire.error.serialization.response Code=-1016 "Request failed: unacceptabl
2016-01-20 22:04
615 查看
在使用AFNetworking 2.0 的时候本来一切很顺畅,但是中途遇到几个比较坑的地方
这里分享一下爬坑经历,忘读者不能速爬坑!
在发送请求后,NSURLSessionDataTask一直报错
Error Domain=com.alamofire.error.serialization.response Code=-1016 "Request failed: unacceptable content-type: text/html"
AFURLResponseSerialization.m中修改代码就能解决:
self.acceptableContentTypes = [NSSet setWithObjects:@"application/json", @"text/json", @"text/javascript", nil];
修改为
self.acceptableContentTypes = [NSSet setWithObjects:@"application/json", @"text/json", @"text/javascript",@"text/html", nil];
相关文章推荐
- UITableView Group类型扁平化适配iOS6.0
- Android BLE与终端通信(一)——Android Bluetooth基础API以及简单使用获取本地蓝牙名称地址
- Android BLE与终端通信(一)——Android Bluetooth基础API以及简单使用获取本地蓝牙名称地址
- 简述UIViewControl之间的七种传值方式
- request \response 总结
- 【慕课笔记】第四章 流程控制语句 第10节 JAVA循环跳转语句之continue
- servlet 之request
- LeetCode 225 Implement Stack using Queues(用队列来实现栈)(*)
- mui中文在线手册及教程文档
- HDU1242 Rescue(BFS松弛)
- C#queue队列总结
- LeetCode 232 Implement Queue using Stacks(用栈来实现队列)(*)
- HBuilder mui引导页制作
- HBuilder教程
- Ubuntu 安装FMS A required package, libcap, was not found 解决方案
- UML建模之时序图(Sequence Diagram)
- 定义DoubleArray并将其作为value写入SequenceFile
- Arduino接口-week3-Lesson1
- Item 21: 比起直接使用new优先使用std::make_unique和std::make_shared
- Rescue