REST.Client.TRESTClient.Authenticator
Delphi
property Authenticator: TCustomAuthenticator read GetAuthenticator write SetAuthenticator;
C++
__property Authenticator;
プロパティ
種類 | 可視性 | ソース | ユニット | 親 |
---|---|---|---|---|
property | published | REST.Client.pas REST.Client.hpp |
REST.Client | TRESTClient |
説明
サーバーに対する認証に使用される、TCustomAuthenticator のサブクラスのインスタンスです。
REST.Client.TRESTClient.Authenticator は REST.Client.TCustomRESTClient.Authenticator を継承しています。以下の内容はすべて REST.Client.TCustomRESTClient.Authenticator を参照しています。
サーバーに対する認証に使用される、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;