AFNetworking 修改

相比大家刚刚拿到AFNetworking  post  和 get 请求数据的时候都会有些小问题吧  

NSLocalizedDescription=Request failed: unacceptable content-type: text/html

就是这个   修改的话很简单

解决方法:

修改AFNetworking中AFURLResponseSerialization.m文件

在223行,将

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

改成

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

增加了一个 @"text/html"

加入这个格式就好了

原文地址:https://www.cnblogs.com/liumingxin123/p/5519742.html