R
Raterus
Hello,
I'm using the WebClient class to query my webserver to get the contents of a certain page (protected with windows integrated security), I have no problems doing this, but have noticed the WebClient Class does not send the credentials I set until it gets an HTTP 401 return code.
We have just created a program to scan the IIS log files for authentication failures. I've noticed in these logs that the WebClient class actually makes two requests of the webserver, it first tries to get the page without sending the credentials, which fails with a 401 error. It tries immediately afterward, sending the credentials, which my webserver responds with the contents.
I'd really like to configure the WebClient class to send the credentials immediately, and not wait for the 401. Is this possible to do? It's messing up my program that scans the log files for 401 errors!
Thanks,
--Michael
I'm using the WebClient class to query my webserver to get the contents of a certain page (protected with windows integrated security), I have no problems doing this, but have noticed the WebClient Class does not send the credentials I set until it gets an HTTP 401 return code.
We have just created a program to scan the IIS log files for authentication failures. I've noticed in these logs that the WebClient class actually makes two requests of the webserver, it first tries to get the page without sending the credentials, which fails with a 401 error. It tries immediately afterward, sending the credentials, which my webserver responds with the contents.
I'd really like to configure the WebClient class to send the credentials immediately, and not wait for the 401. Is this possible to do? It's messing up my program that scans the log files for 401 errors!
Thanks,
--Michael