Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Basic Authentication Error
#2
(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;

Reply


Messages In This Thread
Basic Authentication Error - by staff@ergosoft.it - 12-04-2023, 11:20 AM
RE: Basic Authentication Error - by rlebeau - 12-04-2023, 05:48 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)