REST.Client.TCustomRESTRequest.TBody.Add

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

Delphi

procedure Add(const ABodyContent: string; AContentType: TRESTContentType = ctNone); overload;
procedure Add<T: class, constructor>(AObject: T; AOwnsObject: TRESTObjectOwnership = ooApp); overload;
procedure Add(AObject: TJsonObject; AOwnsObject: TRESTObjectOwnership = ooApp); overload;
procedure Add(ABodyContent: TStream; AContentType: TRESTContentType = ctNone;
AOwnsStream: TRESTObjectOwnership = ooCopy); overload;

C++

void __fastcall Add(const System::UnicodeString ABodyContent, Rest::Types::TRESTContentType AContentType = Rest::Types::TRESTContentType())/* overload */;
template<typename T> void __fastcall Add(T AObject, Rest::Types::TRESTObjectOwnership AOwnsObject = (Rest::Types::TRESTObjectOwnership)(0x2))/* overload */;
void __fastcall Add(System::Json::TJSONObject* AObject, Rest::Types::TRESTObjectOwnership AOwnsObject = (Rest::Types::TRESTObjectOwnership)(0x2))/* overload */;
void __fastcall Add(System::Classes::TStream* ABodyContent, Rest::Types::TRESTContentType AContentType = Rest::Types::TRESTContentType(), Rest::Types::TRESTObjectOwnership AOwnsStream = (Rest::Types::TRESTObjectOwnership)(0x0))/* overload */;

プロパティ

種類 可視性 ソース ユニット
procedure
function
public
REST.Client.pas
REST.Client.hpp
REST.Client TBody


説明

指定された内容を要求の本体パラメータとして使用します。

要求の本体パラメータの新しい値を指定する方法は次の 4 とおりあります。

  • ABodyContent文字列またはストリームの場合、Add では、指定されたコンテンツ タイプの指定の内容を要求の本体パラメータとして使用します。
  • AObjectTJSONObject のインスタンスまたは指定された型のオブジェクトである場合、Add では、指定されたオブジェクトを JSON としてシリアル化し、そのシリアル化されたデータを要求の本体パラメータの値として使用します。

通常、Add を呼び出すと、本体パラメータの前の値が置き換えられます。ただし、ABodyContent を文字列として渡す場合は、指定した値が付け加えられ、結果として生成される要求には複数の本体パラメータが含まれています。それぞれの本体パラメータの名前は、"body" の後にランダムな GUID が付いたものになります。

関連項目