After Android4.0.4, the server returns 401 or 407, the main reason for not getting the message body is an error, the content is:
Java.io.IOException:No Authentication Challenges found
, and the reason for this exception is that after Android4.0.4, the server returns 401 or 407 of the message header is verified, if the server in the message header added "www-authenticate:xxx realm=" XXX " ", there is no problem, otherwise the IOException will be thrown in the httpurlconnection getresponsecode () method.
For example:
Www-authenticate:basic realm= "Wjy"
It should be noted here that "" "in"wjy"" "must not be missing, if it is missing, the same cannot be verified.
This article is from the "Maybe You" blog, please be sure to keep this source http://wjyzxc.blog.51cto.com/5725897/1637110
When the server returns 401 or 407, the solution to the message body is not available after Android4.0.4