HTTP Request

Please support our C# advertiser: Intel Parallel Studio Home
Reply

Join Date: Jan 2009
Posts: 68
Reputation: gallian99 is an unknown quantity at this point 
Solved Threads: 0
gallian99 gallian99 is offline Offline
Junior Poster in Training

HTTP Request

 
0
  #1
Apr 6th, 2009
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
Reply With Quote Quick reply to this message  
Join Date: Jan 2009
Posts: 68
Reputation: gallian99 is an unknown quantity at this point 
Solved Threads: 0
gallian99 gallian99 is offline Offline
Junior Poster in Training

Re: HTTP Request

 
0
  #2
Apr 6th, 2009
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?
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC