version 5.9

alexbk664 months ago

Found the problem, thanks Anton.

Track-trace4 months ago

You are going to tell for others how you solved it ?

alexbk664 months ago

Sure. I was using

WebClient.Credentials = new NetworkCredential(usr, pwd);

But I found the following:

This works ONLY if the server returns 401 first. The client DOES NOT send credentials on first request, ONLY after a 401

This sounds more like 'digest' authentication, not 'basic'. So this code works instead:

string credentials = Convert.ToBase64String(Encoding.UTF8.GetBytes(usr + ":" + pwd));
WebClient.Headers[HttpRequestHeader.Authorization] = $"Basic {credentials}";

Not sure why and when it changed though.