//从输入流读取返回内容
InputStream is = null;
int status = connection.getResponseCode();
if(status>= HttpStatus.SC_BAD_REQUEST){ //此处一定要根据返回的状态码state来初始化输入流。如果为错误
is = connection.getErrorStream();
}else{
//如果正确
is = connection.getInputStream();
}
标签:pre bad ons nec request erro 根据 file put
//从输入流读取返回内容
InputStream is = null;
int status = connection.getResponseCode();
if(status>= HttpStatus.SC_BAD_REQUEST){ //此处一定要根据返回的状态码state来初始化输入流。如果为错误
is = connection.getErrorStream();
}else{
//如果正确
is = connection.getInputStream();
}
关于HttpURLConnection/HttpsURLConnection请求出现了io.filenotfoundexception:url的解决方法
标签:pre bad ons nec request erro 根据 file put
原文地址:https://www.cnblogs.com/xiangxinhouse/p/8366931.html