iOS"Request failed: unacceptable content-type: text/html"

获取服务器响应出错 error=Error Domain=com.alamofire.error.serialization.response Code=-1016 "Request failed: unacceptable content-type: text/html" UserInfo=0x7fdfd8729680 {com.alamofire.serialization.response.error.response= { URL: http://172.16.1.31:7001/itom/getwork } { status code: 200, headers {
    "Cache-Control" = "no-cache";
    "Content-Type" = "text/html;charset=UTF-8";
    Date = "Mon, 24 Nov 2014 03:13:16 GMT";
    "Transfer-Encoding" = Identity;
    "X-Powered-By" = "Servlet/2.5 JSP/2.1";
} }, NSErrorFailingURLKey=http://172.16.1.31:7001/itom/getwork, com.alamofire.serialization.response.error.data=<5b7b2273 74617475 73223a22 73756363 65737322 2c226d73 67223a22 e799bbe9 9986e688 90e58a9f 227d5d>, NSLocalizedDescription=Request failed: unacceptable content-type: text/html}


  AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];

    manager.responseSerializer.acceptableContentTypes = [NSSet setWithObjects:@"text/html",@"text/plain",@"application/json",nil];

添加一种服务器返回的数据格式 text/html。

你可能感兴趣的:(ios,AFNetworking,content,unacceptable)