您的位置:首页 > 产品设计 > UI/UE

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];
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  源文件 failed Error
相关文章推荐