how do I transform the CURL in Rest command ?
what is wrong
curl -X GET --header "Accept: application/json" --header "X-Authorization: Bearer "Token"" "http://console.agrolog.io:8080/api/auth/user"
Delphi code:
RESTClient1.BaseURL := 'http://console.agrolog.io:8080/api/';
RESTRequest1.Method := TRESTRequestMethod.rmGET;
RESTRequest1.Resource := 'auth/user';
RESTRequest1.Params.Clear;
with RESTRequest1.Params.AddItem do
begin
ContentType := ctAPPLICATION_JSON;
name := 'Authorization';
Value := 'X-Authorization: Bearer ' + '"'+Strtoken+'"' ;
Kind := pkHTTPHEADER;
end;
RESTRequest1.Execute;
The error is EHTTPProtocolException with Message 'HTTP/1.1 401'
Bearer xxxxxxxxxxxxxxxxxx(without any quotes). - Wouter van Nifterick