HttpWebRequest problem
I use the HttpWebRequest class in VB.Net to return HTML from a page on
a remote server. The code works correctly on my machine and on another
server (the code extracts the HTML from the same location on the
remote server), but if I run the code on the server itself I receive
an unspecified error. The code that I use is as follows (url is
replaced with the correct website address on the server).
Dim Req As HttpWebRequest = CType(WebRequest.Create(url), WebRequest)
Req.ProtocolVersion = HttpVersion.Version11
Req.Method = "GET"
Req.Accept = "*/*"
Req.Credentials = CredentialCache.DefaultCredentials
result = Req.GetResponse()
I have checked the server variables to ensure that Version 11 is the
correct ProtocolVersion. Is there a setting on the server that needs
to be changed to allow it to make web requests, or are there
alterations that need to be made to my code?
Thanks in advance for all help.
Date:Mon, 06 Aug 2007 09:09:59 -0700
Author:
|