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];

猜你喜欢

转载自www.cnblogs.com/KiVen2015/p/9272681.html