ref:http://blog.csdn.net/nyh1006/article/details/25068255
1. Error message: Error:error domain=afnetworkingerrordomain code=-1016 "Request failed:unacceptable content-type:text/html" userinfo=0x16dcec00 {nserrorfailingurlkey=http://www.weather.com.cn/data/sk/101110101.html, afnetworkingoperationfailingurlresponseerrorkey=<nshttpurlresponse:0x16d5deb0> {url:http:// www.weather.com.cn/data/sk/101110101.html} {Status code:200, headers {
Connection = "Keep-alive";
"Content-encoding" = gzip;
"Content-type" = "text/html; Charset=utf-8 ";
Date = "Mon, 09:40:27 GMT";
Server = "apache/2.2.0";
"Transfer-encoding" = Identity;
}}, Nslocalizeddescription=request failed:unacceptable content-type:text/html}
Reason:
Afnetworking default does not support text/html
AFURLRESPONSESERIALIZATION.M Source-self.acceptablecontenttypes = [Nsset setwithobjects:@ "Application/json", @ "text /json ", @" Text/javascript ", nil];
Workaround:
1) Add @ "text/html" at the author source code.
2) Add this code at your own code:
Manager.responseSerializer.acceptableContentTypes = [Nsset setwithobject:@ "text/html"];
What type do you need to fill that type, like I'm Text/plain
Reference information:
Http://www.cocoachina.com/bbs/simple/?t176000.html
http://www.cocoachina.com/ask/questions/show/108598
Https://github.com/AFNetworking/AFNetworking/blob/master/README.md
Afnetworking Content Type not support