判断getResponseCode,当返回不是HttpURLConnection.HTTP_OK, HttpURLConnection.HTTP_CREATED, HttpURLConnection.HTTP_ACCEPTED 时,不能用getInputStream(),而是应该用getErrorStream()。修改代码,问题解决。
判断getResponseCode,当返回不是HttpURLConnection.HTTP_OK, HttpURLConnection.HTTP_CREATED, HttpURLConnection.HTTP_ACCEPTED 时,不能用getInputStream(),而是应该用getErrorStream()。修改代码,问题解决。