response Code=-1016 “Request failed: unacceptable content-type: text/html”
2016-10-12 12:14
501 查看
使用AFNetworking时,请求提示如下错误:Error Domain=com.alamofire.error.serialization.response Code=-1016 “Request failed: unacceptable content-type: text/html”解决方法:在AF的源文件AFURLResponseSerialization.m中修改代码就能解决:修改文件223行处
self.acceptableContentTypes = [NSSet setWithObjects:@"application/json", @"text/json", @"text/javascript", nil];修改为:
self.acceptableContentTypes = [NSSet setWithObjects:@"application/json", @"text/json", @"text/javascript",@"text/html", nil];
相关文章推荐
- Domain=com.alamofire.error.serialization.response Code=-1016 "Request failed: unacceptable content-type: text/html"
- AFNetworking 遇到错误 Code=-1016 "Request failed: unacceptable content-type: text/plain"
- Code=-1016 "Request failed: unacceptable content-type: text/html"问题
- 使用AFNetworking 2.0 请求数据时出现错误 Request failed: unacceptable content-type: text/html 解决方法
- 使用AFNetworking网络请求时出现错误"Request failed: unacceptable content-type: text/html"
- AF请求数据失败,提示Request failed: unacceptable content-type: text/html
- iOS 使用AFNetworking遇到错误 Request failed: unacceptable content-type: text/html
- iOS AFNetworking “Request failed: unacceptable content-type: text/html”问题
- iOS"Request failed: unacceptable content-type: text/html"
- 报错:Request failed: unacceptable content-type: text/html
- AFNetworking 报错 Request failed: unacceptable content-type: text/html
- iOS"Request failed: unacceptable content-type: text/html"
- Request failed: unacceptable content-type: text/html
- OS"Request failed: unacceptable content-type: text/html"
- AFNetWorking请求时, “Request failed: unacceptable content-type: text/html”
- iOS AFNetworking “Request failed: unacceptable content-type: text/html”问题
- iOS上传失败提示"Request failed: unacceptable content-type: text/html"
- iOS"Request failed: unacceptable content-type: text/html"
- iOS"Request failed: unacceptable content-type: text/html"
- iOS"Request failed: unacceptable content-type: text/html"