1
Answer

[C#] HTTPwebrequest Multiple Authentications

Dan Raby

Dan Raby

16y
4.1k
1
I am creating a Windows Form App that reaches out to 2 devices every 3 seconds and pulls an XML file, parses the stats, and raises alarms. The devices that I am pulling the xml files from are password protected with Digest (nonce).

1. Send the first HTTP request
2. Catch the WebException and parse the 401 error for the nonce.
3. Generate the response.
4. Send the revised Request.

The problem I am having is that I have to do this every time I update the stats.

When I get the xml from a web browser, I only have to authenticate once, and it saves it. I am hoping there is a way to create a session or something so I don't have to repeat this 2 times every 3 seconds for 6 hours.

I have code to post. I am hoping it is something that can be solved without it.
Answers (1)