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::Sysutils::TBytes 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 */;
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
function | public | REST.Client.pas REST.Client.hpp |
REST.Client | TRESTRequestParameterList |
Description
Adds a REST request parameter to the list of parameters and returns the added parameter.
If a parameter with the same name already exists, it will be removed and freed.
There are five kinds of parameters:
GetorPost
can be a QueryString or encoded form value based on a method.HttpHeader
adds a name/value pair to the HTTP request Header collection.UrlSegment
is inserted into the URL if there is a matching URL token e.g.Account Id
.Cookie
adds the name/value pair to the HTTP request cookies collection.RequestBody
is used by AddBody. (It is not recommended to use it directly).
The AddItem accepts different combinations of the following parameters:
AName
is the name that identifies the parameter.AValue
is the value of the parameter, which you may specify as a string, as an array of bytes or as a stream.AKind
is the kind of the parameter, which ispkGETorPOST
by default.AOptions
is a set of options for the parameter, which is empty by default.AContentType
is the type of content of the parameter, which is DefaultRESTContentType by default.AOwnsStream:TRESTObjectOwnership
is aAValue:TStream
parameter that controls the ownership of the stream value.