(12-04-2023, 11:20 AM)staff@ergosoft.it Wrote: I have a problem on a API REST call.
I always get the authentication error: HTTP/1.1 401 Unauthorized
TIdHTTP has built-in support for BASIC authentication at the HTTP layer. Are you sure you should be sending your credentials in the POST body? Do you get the same error if you use the standard HTTP Authorization header instead? TIdHTTP has properties for that purpose:
Code:
lHTTP.Request.BasicAuthentication := True;
lHTTP.Request.Username := myUser;
lHTTP.Request.Password := MyPass;