WebRequest GetResponse getting Internal Server Error

  • Thread starter William F. Robertson, Jr.
  • Start date
W

William F. Robertson, Jr.

I am having problems with using the WebRequest object (or HttpWebRequest ).

I have created the WebRequest and set the credentials, but when I call
GetResponse() it is throwing an internal server error 500 on me.

I am running a console app on my sql server that is trying to create a
WebRequest to my Webserver to notify the cache on the webserver to refresh
itself.

The website is using NT authentication. The user I am using is in the Admin
group on the webserver and can access through the network (KB article said
to check that)

<code>
HttpWebRequest request = ( HttpWebRequest ) WebRequest.Create(
"http://server/page.aspx?Cachename=" + args[0] );
request.PreAuthenticate = true;
request.Credentials = new NetworkCredential( "user", "pass", "domain" );

request.GetResponse(); // throws exception.
</code>

Any ideas? Anything more I can do?

Thanks,

bill
 
J

jimgserious

Hi Bill,

i had the same issue. webrequest has an error hadling class
webexception which you can use to get the html of the page and read th
500 erro
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top