I'm trying to establish a connection, but var httpResponse = (HttpWebResponse) httpWebRequest.GetResponse(); I get the following error in the line of code:
The remote server returned an error: (500) Internal Server Error
var httpResponse = (HttpWebResponse)httpWebRequest.GetResponse();
In this case, when an exception occurs, not only does StatusCode mark the error code of HTTP in WebException, but its Response attribute also contains the WebResponse sent by the server to indicate the actual HTTP error encountered.
Member
35 Points
94 Posts
HttpWebRequest Get.Response Error : The remote server returned an error: (500) Internal Server Er...
Aug 08, 2019 06:44 AM|kortmazsefa|LINK
Hello
I'm trying to establish a connection, but var httpResponse = (HttpWebResponse) httpWebRequest.GetResponse(); I get the following error in the line of code: The remote server returned an error: (500) Internal Server Error
I was unable to resolve this error
My codes are :
Contributor
3140 Points
983 Posts
Re: HttpWebRequest Get.Response Error : The remote server returned an error: (500) Internal Serve...
Aug 08, 2019 08:38 AM|Yang Shen|LINK
Hi kortmazsefa,
This is most likely caused by error in your httpWebRequest.
Please try :
insead of :
In this case, when an exception occurs, not only does StatusCode mark the error code of HTTP in WebException, but its Response attribute also contains the WebResponse sent by the server to indicate the actual HTTP error encountered.
You can also refer to here for more details.
Best Regard,
Yang Shen