REST.Client.TCustomRESTClient.Authenticator

提供: RAD Studio API Documentation
移動先: 案内検索

Delphi

property Authenticator: TCustomAuthenticator read GetAuthenticator write SetAuthenticator;

C++

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

プロパティ

種類 可視性 ソース ユニット
property public
REST.Client.pas
REST.Client.hpp
REST.Client TCustomRESTClient


説明

サーバーに対する認証に使用される、TCustomAuthenticator のサブクラスのインスタンスです。

Authenticator はデフォルトでは nil です。つまり、認証が行われないということです。

TCustomRESTClient は、それ自身の認証コンポーネントの所有者になります。その結果、Authenticator プロパティに新しい値を割り当てても、前の認証コンポーネントを破棄する必要はありません。

コード例

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;

関連項目