AFN —— unacceptable content-type: text/html"

用AFN发送请求的时候服务器返回这样的错误

“unacceptable content-type: text/html"”

解决方案:

对应到自己的项目里面,需要改的是:

找到AFURLResponseSerialization.m文件

223行:

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

加上蓝色部分,其实就是添加一种服务器返回的数据格式。

ok,请求成功ing!

AFN —— unacceptable content-type: text/html"