Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Basic Authentication Error
#3
(12-04-2023, 05:48 PM)rlebeau Wrote:
(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;

Thank you ! works


Alessandro Romano
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
RE: Basic Authentication Error - by staff@ergosoft.it - 12-05-2023, 09:35 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)