REST.Client.TCustomRESTRequest.TBody.Add
Delphi
procedure Add(ABodyContent: string; AContentType: TRESTContentType = ctNone); overload;
procedure Add<T: class, constructor>(AObject: T); overload;
procedure Add(AObject: TJsonObject); overload;
procedure Add(ABodyContent: TStream; AContentType: TRESTContentType = ctNone); overload;
C++
void __fastcall Add(System::UnicodeString ABodyContent, Rest::Types::TRESTContentType AContentType = (Rest::Types::TRESTContentType)(0x0))/* overload */;
template<typename T> void __fastcall Add(T AObject)/* overload */;
void __fastcall Add(System::Json::TJSONObject* AObject)/* overload */;
void __fastcall Add(System::Classes::TStream* ABodyContent, Rest::Types::TRESTContentType AContentType = (Rest::Types::TRESTContentType)(0x0))/* overload */;
プロパティ
種類 | 可視性 | ソース | ユニット | 親 |
---|---|---|---|---|
procedure function |
public | REST.Client.pas REST.Client.hpp |
REST.Client | TBody |
説明
指定された内容を要求の本体パラメータとして使用します。
要求の本体パラメータの新しい値を指定する方法は次の 4 とおりあります。
ABodyContent
が文字列またはストリームの場合、Add では、指定されたコンテンツ タイプの指定の内容を要求の本体パラメータとして使用します。AObject
が TJSONObject のインスタンスまたは指定された型のオブジェクトである場合、Add では、指定されたオブジェクトを JSON としてシリアル化し、そのシリアル化されたデータを要求の本体パラメータの値として使用します。
通常、Add を呼び出すと、本体パラメータの前の値が置き換えられます。ただし、ABodyContent
を文字列として渡す場合は、指定した値が付け加えられ、結果として生成される要求には複数の本体パラメータが含まれています。それぞれの本体パラメータの名前は、"body" の後にランダムな GUID が付いたものになります。