HttpStatusCode 307 handling
Dear team
During testing I identified an topic that runs into an error by using the wrapper. I'm using the SampleWdpClient app and randomly during request to the device, the device responses a request with a 307 state code and the wrapper follows the redirected uri an gets an html page as answer. As result, the deserializer fails because the answer isn't an json string.
In the most of the request, the device answers the request with an 401, the httpclient sends the credentials and all works well. Except in some cases (all 2-4 times) the device answers with an 307 and the wrapper fails.
Do I have to configure the devices differently (I tested more than one with the same result) ? I'm using the last nuget version (0.9.5.1)
below the wireshark trace:


thanks a million.
Hi @haeberle , are you using this against an IoT device? If so, we've identified the issue and are working to fix it in the WDP product itself.
The root cause here is that the .NET framework for HTTP purposefully sends the request without credentials, then responds with creds on a 401. Unfortunately the IoT Authenticator module in WDP counts cred-less requests as bad faith login attempts and ticks up a counter to mark whether they should be redirected to the login page.
Hello @hpsin thanks a lot for the explanation. Yes, I'm using Win10 IoT on a raspberry.
I fixed it quick & dirty in GetAsync<..> by executing the request again in case the response status code is 307.
That helps as long no other clients request the page parallel as implemented in the WDP.
Thanks! That's a good workaround. I'm going to leave this open until @namkedia confirms that the fix internally is checked in.
Push for fix in trunk.