version 5.9

alexbk66a year ago

Found the problem, thanks Anton.

Track-tracea year ago

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

alexbk66a year 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.