HttpWebRequest
-
Hi , i am trying to retreive an xml doc from another server on the same domain where my computer resides i am using HttpWebRequest from c# code but i am getting the below error how can i solve this problem without hardcoding a user name and password in the code ? thanks
The remote server returned an error: (401) Unauthorized.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.Exception Details: System.Net.WebException: The remote server returned an error: (401) Unauthorized.
Source Error:
Line 41:
Line 42: //From here on, it's all the same as above.
Line 43: HttpWebResponse WebResp = (HttpWebResponse)WebReq.GetResponse();
Line 44: //Let's show some information about the response
Line 45: Console.WriteLine(WebResp.StatusCode); -
Hi , i am trying to retreive an xml doc from another server on the same domain where my computer resides i am using HttpWebRequest from c# code but i am getting the below error how can i solve this problem without hardcoding a user name and password in the code ? thanks
The remote server returned an error: (401) Unauthorized.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.Exception Details: System.Net.WebException: The remote server returned an error: (401) Unauthorized.
Source Error:
Line 41:
Line 42: //From here on, it's all the same as above.
Line 43: HttpWebResponse WebResp = (HttpWebResponse)WebReq.GetResponse();
Line 44: //Let's show some information about the response
Line 45: Console.WriteLine(WebResp.StatusCode);Allow anonymous to the page you are requesting...
I didn't get any requirements for the signature