用AFNetworking的时候,报警告:"Request failed: unacceptable content-type: text/plain"。百度出来说AFNetworking不支持text/plain,这个格式。
解决办法1.:在头文件"AFURLResponseSerialization.m"的如下地方添加text/plain就行了。问题解决。
self.acceptableContentTypes = [NSSet setWithObjects:@"application/json", @"text/plain",@"text/json", @"text/javascript", nil];
解决办法2.添加一句代码:
AFHTTPSessionManager *mgr = [AFHTTPSessionManager manager];
mgr.responseSerializer.acceptableContentTypes = [NSSet setWithObjects:@"text/plain",@"application/json", @"text/json", @"text/javascript",nil];