SetHeaders

Syntax 1: for TokenRequest objects

Description

Sets the header information of all requests. If SetHeader or SetHeaders is not used to set the header for Authorization, the program will automatically set the header for Authorization and Content-type.

Applies to

TokenRequest objects

Syntax

objectname.SetHeaders ( string headers )

Argument

Description

objectname

A reference to the TokenRequest object in which you want to set the request header.

headers

A string specifying all of the header names.


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 SetHeaders function to set the value of the content-type header and the charset header:

int li_return
TokenRequest lnv_TokenRequest

li_return = lnv_TokenRequest.setheaders("content-type:application/x-www-form-urlencoded; charset=UTF-8~r~nCache-Control:no-cache")

See also

AppendParam

ClearHeaders

GetHeader

GetHeaders

SetHeader

Syntax 2: for OAuthRequest objects

Description

Sets the header information of all requests.

Applies to

OAuthRequest objects

Syntax

objectname.SetHeaders ( string headers )

Argument

Description

objectname

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

headers

A string specifying all of the header names.


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 SetHeaders function to set the value of the content-type header and the charset header:

int li_return
OAuthRequest lnv_OAuthRequest

li_return = lnv_OAuthRequest.setheaders("content-type:application/x-www-form-urlencoded; charset=UTF-8~r~nCache-Control:no-cache")

See also

ClearHeaders

GetBody

GetHeader

GetHeaders

SetAccessToken

SetBody

SetHeader