发送请求时出现400错误,错误代码为:webresponse = (httpwebresponse)webrequest.getresponse();
解决办法:抛出异常
httpwebresponse webresponse; try { webresponse = (httpwebresponse)webrequest.getresponse(); //请求页面信息 } catch (webexception ex) { webresponse = (httpwebresponse)ex.response; //获得错误发生时候服务器段错误页面的源代码 }
黄山市民网:https://www.huangshanshimin.com/