500 error while GetResponse()



Hi All,

I'm trying to make a web request to my site from some other ASP.Net
Application. Code used for that is:

string sURL = "<my site url>";

HttpWebRequest wrGETURL = (HttpWebRequest) WebRequest.Create(new Uri(sURL));

wrGETURL.UserAgent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0;
..NET CLR 1.1.4322)";

wrGETURL.AllowAutoRedirect = true;
wrGETURL.CookieContainer = new CookieContainer();

wrGETURL.CookieContainer.Add(new Uri(sURL), new Cookie("bhResults",
"bhtz=0"));

wrGETURL.CookieContainer.Add(new Uri(sURL), new Cookie("bhPrevResults",
"bhtz=0"));

HttpWebResponse webresponse = (HttpWebResponse)wrGETURL.GetResponse();

I get an error when GetResponse() is executed. The error is :

"The remote server returned an error: (500) Internal Server Error."

Any ideas why i'm getting this error?

Thnx in advance.
Pooja.
.



Relevant Pages

  • RE: HttpWebRequest and Multi Threaded Apps
    ... You have to be careful when using the HttpWebRequest and HttpWebResponse ... The .NET ThreadPool only have 25 threads so if you ... If you think that a particular web request is taking too long I suggest ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: httpwebrequest error
    ... issue a web request thru VB.Net windows application. ... code for using web request but I’m getting it on my code as well. ... Dim myHttpWebRequest As HttpWebRequest ...
    (microsoft.public.dotnet.general)
  • Re: HTTPWebrequest foreign characters are excluded in the response stream.
    ... > in the response stream I am not getting some foreign characters ... > I am sending all the required headers with the HTTPWebrequest. ... > ' Setup our Web request ...
    (microsoft.public.dotnet.general)

Loading