REST.Client.TRESTRequestParameterList.AddItem
Delphi
function AddItem: TRESTRequestParameter; overload;
function AddItem(const AName, AValue: string; AKind: TRESTRequestParameterKind;
AOptions: TRESTRequestParameterOptions = []): TRESTRequestParameter; overload;
function AddItem(const AName, AValue: string): TRESTRequestParameter; overload;
function AddItem(const AName, AValue: string; const AKind: TRESTRequestParameterKind;
const AOptions: TRESTRequestParameterOptions; AContentType: TRESTContentType): TRESTRequestParameter;
function AddItem(const AName: string; const AValue: TBytes; const AKind: TRESTRequestParameterKind;
const AOptions: TRESTRequestParameterOptions; AContentType: TRESTContentType): TRESTRequestParameter;
function AddItem(const AName: string; const AValue: TStream; const AKind: TRESTRequestParameterKind;
const AOptions: TRESTRequestParameterOptions; AContentType: TRESTContentType;
AOwnsStream: TRESTObjectOwnership = ooCopy): TRESTRequestParameter;
C++
TRESTRequestParameter* __fastcall AddItem()/* overload */;
TRESTRequestParameter* __fastcall AddItem(const System::UnicodeString AName, const System::UnicodeString AValue, Rest::Types::TRESTRequestParameterKind AKind, Rest::Types::TRESTRequestParameterOptions AOptions = Rest::Types::TRESTRequestParameterOptions() )/* overload */;
TRESTRequestParameter* __fastcall AddItem(const System::UnicodeString AName, const System::UnicodeString AValue)/* overload */;
TRESTRequestParameter* __fastcall AddItem(const System::UnicodeString AName, const System::UnicodeString AValue, const Rest::Types::TRESTRequestParameterKind AKind, const Rest::Types::TRESTRequestParameterOptions AOptions, Rest::Types::TRESTContentType AContentType)/* overload */;
TRESTRequestParameter* __fastcall AddItem(const System::UnicodeString AName, const System::DynamicArray<System::Byte> AValue, const Rest::Types::TRESTRequestParameterKind AKind, const Rest::Types::TRESTRequestParameterOptions AOptions, Rest::Types::TRESTContentType AContentType)/* overload */;
TRESTRequestParameter* __fastcall AddItem(const System::UnicodeString AName, System::Classes::TStream* const AValue, const Rest::Types::TRESTRequestParameterKind AKind, const Rest::Types::TRESTRequestParameterOptions AOptions, Rest::Types::TRESTContentType AContentType, Rest::Types::TRESTObjectOwnership AOwnsStream = (Rest::Types::TRESTObjectOwnership)(0x0))/* overload */;
プロパティ
種類 | 可視性 | ソース | ユニット | 親 |
---|---|---|---|---|
function | public | REST.Client.pas REST.Client.hpp |
REST.Client | TRESTRequestParameterList |
説明
REST 要求パラメータをパラメータ リストに追加し、追加したパラメータを返します。
同じ名前のパラメータが存在する場合、削除または解放されます。
5 種類のパラメータがあります:
GetorPost
は、QueryString か、メソッドに基づいてエンコードされたフォーム値です。HttpHeader
は、「名前/値」ペアを HTTP リクエスト ヘッダー コレクションに追加します。UrlSegment
は、一致する URL トークン(例:Account Id
など)がある場合に URL に挿入されます。Cookie
は、「名前/値」ペアを HTTP リクエスト クッキー コレクションに追加します。RequestBody
は、AddBody によって使用されます。(直接使用することは推奨されません)。
AddItem は、次のパラメータの多様なコンビネーションを受け付けます:
AName
: パラメータを識別する名前。AValue
: パラメータの値(文字列、バイト配列、ストリームのどちらかで指定可能)。AKind
: パラメータの種類(デフォルトではpkGETorPOST
)。AOptions
: パラメータのオプション セット(デフォルトでは空)。AContentType
: パラメータのコンテンツ タイプ(デフォルトでは DefaultRESTContentType)。AOwnsStream:TRESTObjectOwnership
はAValue:TStream
パラメータで、ストリーム値の所有権を制御します。