SetBody

Description

Sets the request body.

Applies to

OAuthRequest objects

Syntax

objectname.SetBody ( string data )
objectname.SetBody ( blob data )
objectname.SetBody ( string data, encoding encodingType )

Argument

Description

objectname

A reference to the OAuthRequest object in which you want to set the request body.

data

A string or blob specifying the data. The data will be converted to EncodingUTF8!.

encodingType

An encoding value specifying the string data.


Return value

Integer.

Returns 1 if it succeeds and -1 if an error occurs. If any argument's value is null, the method returns null.

Examples

The following example shows the use of the SetBody function to set the request body of string data type:

int li_return
string ls_data
OAuthRequest lnv_OAuthRequest

li_return = lnv_OAuthRequest.setbody(ls_data)

The following example shows the use of the SetBody function to set the request body of string data type in encodingUTF8!:

int li_return
string ls_data
OAuthRequest lnv_OAuthRequest

li_return = lnv_OAuthRequest.setbody(ls_data, encodingUTF8!)

The following example shows the use of the SetBody function to set the request body of blob data type:

int li_return
blob lblb_data
OAuthRequest lnv_OAuthRequest

li_return = lnv_OAuthRequest.setbody(lblb_data)

See also

ClearHeaders

GetBody

GetHeader

GetHeaders

SetAccessToken

SetHeader

SetHeaders