Registriert seit: 18. Mär 2004
Ort: Luxembourg
3.492 Beiträge
Delphi 7 Enterprise
|
AW: RESTClient Basic Auth. funkt nicht
19. Dez 2017, 09:27
Ich habe jetzt noch mal einen kleinen Test aufgesetzt. Funktioniert.
Delphi-Quellcode:
uses
REST.Client,
REST.Types,
REST.Authenticator.Basic,
IPPeerClient,
IPPeerAPI;
procedure TestRestClient;
var
Client : TRESTClient;
Request : TRESTRequest;
begin
Client := TRESTClient.Create('https://httpbin.org/');
try
Request := TRESTRequest.Create(Client);
try
Request.Method := TRESTRequestMethod.rmGET;
Request.Resource := 'uuid';
Request.Execute;
Writeln(Request.Response.Content);
finally
Request.Free;
end;
finally
Client.Free;
end;
end;
Request:
Code:
GET https://httpbin.org/uuid HTTP/1.1
Host: httpbin.org
Accept: application/json, text/plain; q=0.9, text/ html;q=0.8,
Accept-Charset: UTF-8, *;q=0.8
Accept-Encoding: identity
User-Agent: Embarcadero RESTClient/1.0
Response:
Code:
{
"uuid": "bb60316c-fcc6-4410-87e2-1c73916ce396"
}
Ibi fas ubi proxima merces
sudo /Developer/Library/uninstall-devtools --mode=all
|
|
Zitat
|