首页 > Web开发 > 详细

AFNetworking上传遇到的小问题

时间:2015-01-21 15:16:18      阅读:407      评论: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
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!