AFNetworking上传遇到的小问题

上传图片时出现的问题:

{ 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上传遇到的小问题)