HTTP 400错误
程序员文章站
2022-04-29 16:12:54
发送请求时出现400错误,错误代码为:webResponse = (HttpWebResponse)webRequest.GetResponse(); 解决办法:抛出异常 HttpWebResponse webResponse; try { webResponse = (HttpWebRespons ......
发送请求时出现400错误,错误代码为:webresponse = (httpwebresponse)webrequest.getresponse();
解决办法:抛出异常
httpwebresponse webresponse; try { webresponse = (httpwebresponse)webrequest.getresponse(); //请求页面信息 } catch (webexception ex) { webresponse = (httpwebresponse)ex.response; //获得错误发生时候服务器段错误页面的源代码 }
推荐阅读