AFNetworking 2.0 获取json数据时,返回 NSLocalizedDescription=Request failed: unacceptable content-type: text/html, 解决方法.

 

 

 AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];

 manager.responseSerializer.acceptableContentTypes = [NSSet setWithObject:@"text/html"];

    

 

1:优先让服务器做好返回类型适配

 

2:服务器不做的话, 在程序中再加上上面的代码. 把类型加上.

posted @ 2014-08-27 10:36  willbin  阅读(533)  评论(0编辑  收藏  举报