p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

aspdotnet_website_programming thread: 401 unauthorised / Too many redirections attempts in HTTPS file Request


Message #1 by "saravana" <sarcv@y...> on Thu, 20 Feb 2003 16:05:17
Hi Guys,

I need a help to get HTTPS file in internet. I have Username and Password.

I can able to get that file directly with the Username and PWD thro. 
internet Browser. But I get an error 401(unauthorised) and sometimes .. 
too many redirection attempts .. with the following code

Can anyone help me how to solve this problem?..

  ' Initialize the WebRequest.
  Dim myRequest As WebRequest = WebRequest.Create("URL")
  
  Dim cr As New NetworkCredential("User","Pwd")
  myRequest.Credentials = cr

  myRequest.ContentType = "application/x-www-form-urlencoded"

  ' Return the response. 
  Dim myResponse As WebResponse = myRequest.GetResponse()


  ' Close the response to free resources.
   myResponse.Close()

Thanks in advance,
Saravana.

  Return to Index