解决方法:
判断一下状态返回码然后调用不同的方法。
int code = conn.getResponseCode();//获取返回码
if (code == 200) {
is = conn.getInputStream();
} else {
is = conn.getErrorStream();
}
解决方法:
判断一下状态返回码然后调用不同的方法。
int code = conn.getResponseCode();//获取返回码
if (code == 200) {
is = conn.getInputStream();
} else {
is = conn.getErrorStream();
}