iOS----------网络请求错误

Error Domain=com.alamofire.error.serialization.response Code=-1016 "Request failed: unacceptable content-type: text/html"

解决方案:

在AFNetWorking的源文件AFURLResponseSerialization.m中修改代码: 
修改228行:self.acceptableContentTypes = [NSSet setWithObjects:@"application/json", @"text/json", @"text/javascript", nil];

修改为:     self.acceptableContentTypes = [NSSet setWithObjects:@"application/json", @"text/json", @"text/javascript",@"text/html", nil];

posted @ 2018-07-06 11:26  iOS张文权  阅读(267)  评论(0编辑  收藏  举报