REST.Client.TCustomRESTClient.Authenticator

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property Authenticator: TCustomAuthenticator read FAuthenticator write SetAuthenticator;

C++

__property TCustomAuthenticator* Authenticator = {read=FAuthenticator, write=SetAuthenticator};

Properties

Type Visibility Source Unit Parent
property public
REST.Client.pas
REST.Client.hpp
REST.Client TCustomRESTClient

Description

Instance of a subclass of TCustomAuthenticator to be used for authentication against the server.

Authenticator is nil by default, which means that no authentication is used.

TCustomRESTClient becomes the owner of its authenticator. As a result, you do not need to destroy any previous authenticator when you assign the Authenticator property a new value.

Code Example

Delphi:

LClient := TCustomRESTClient.Create('http://www.example.com');
LBasicAuth := THTTPBasicAuthenticator.Create('JaneDoe', 'secret');
LClient.Authenticator := LBasicAuth;

C++:

TCustomRESTClient* LClient = new TCustomRESTClient("http://www.example.com");
THTTPBasicAuthenticator* LBasicAuth = new THTTPBasicAuthenticator("JaneDoe", "secret");
LClient->Authenticator = LBasicAuth;

See Also