REST.Client.TRESTClient.Authenticator

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property Authenticator: TCustomAuthenticator read GetAuthenticator write SetAuthenticator;

C++

__property Authenticator;

Properties

Type Visibility Source Unit Parent
property published
REST.Client.pas
REST.Client.hpp
REST.Client TRESTClient

Description

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

REST.Client.TRESTClient.Authenticator inherits from REST.Client.TCustomRESTClient.Authenticator. All content below this line refers to REST.Client.TCustomRESTClient.Authenticator.

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