WebRequest...remote server returned an error: (404) Not Found.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm attempting to call a url to return the HTML, however, I get a 404. If
just paste the same url in the browser it works. The code is below. Are
there any specific properties that must be set on the HttpWebRequest? Thanks.

....
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(strUrl);
resp = req.GetResponse(); <--error occurs on this call..
....
 
Back
Top