943,884 Members | Top Members by Rank

Ad:
  • C# Discussion Thread
  • Unsolved
  • Views: 4404
  • C# RSS
Apr 6th, 2009
0

HTTP Request

Expand Post »
Hi,

How can I send http request for authentication?

My current code returns 401 unauthorized access

HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://128.39.141.213/axis-cgi/com/ptz.cgi?camera=1&move=right");

HttpWebResponse response = (HttpWebResponse)request.GetResponse();

Looking for a quick reply
Regards,
A
Similar Threads
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
gallian99 is offline Offline
77 posts
since Jan 2009
Apr 6th, 2009
0

Re: HTTP Request

Even after setting the credentials, I get some sort of error for if I execute the following code/instruction for 3rd time. For the first two times, it performs well and send a http request to the network camera.

HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://128.39.141.213/axis-cgi/com/ptz.cgi?camera=1&move=right");

request.PreAuthenticate = true;
request.Credentials = new NetworkCredential("root","pass");

HttpWebResponse response = (HttpWebResponse)request.GetResponse();

Can anyone help?
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
gallian99 is offline Offline
77 posts
since Jan 2009

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C# Forum Timeline: sql
Next Thread in C# Forum Timeline: the Brigadoon of databases





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC