码迷,mamicode.com
首页 > Web开发 > 详细

AFNetworking上传遇到的小问题

时间:2015-01-21 15:19:12      阅读:171      评论:0      收藏:0      [点我收藏+]

标签:

上传图片时出现的问题:

{ status code: 200, headers {

    Connection = "Keep-Alive";

    "Content-Encoding" = gzip;

    "Content-Length" = 386;

    "Content-Type" = "text/html; charset=utf-8";

    Date = "Wed, 21 Jan 2015 05:45:47 GMT";

    "Keep-Alive" = "timeout=5, max=100";

    Server = "Apache/2.4.7 (Ubuntu)";

    Vary = "Accept-Encoding";

    "X-Powered-By" = "PHP/5.5.9-1ubuntu4.5";

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


AFURLResponseSerialization类中找到acceptableContentTypes添加“text/html”

如下:

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


解决方法

http://stackoverflow.com/questions/19114623/request-failed-unacceptable-content-type-text-html-using-afnetworking-2-0

AFNetworking上传遇到的小问题

标签:

原文地址:http://blog.csdn.net/kevinpake/article/details/42967569

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!