Connection Information

To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host.

Connection Type

SetRequestHeader – PB Docs 2022 – PowerBuilder Library

SetRequestHeader – PB Docs 2022

SetRequestHeader

PowerScript function

Description

Sets the request header.

Applies to

HTTPClient and RestClient objects

Syntax

Argument

Description

objectname

The name of the HTTPClient or RestClient object in which
you want to set the request header.

headerName

A string whose value is the header name.

headerValue

A string whose value is the header value.

replace (optional)

A boolean determines whether to replace the current
existing request value if the same header name already
exists.

  • TRUE — to replace the value in the current existing
    request header if the same header name already
    exists.

  • FALSE — to add the value (with a “,”) to the current
    existing request header if the same header name already
    exists. The default value is FALSE.

Note: use this argument cautiously (TRUE is recommended)
when you specify the charset in the “Content-Type” header,
because no more than one charset is allowed.

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

This example constructs a GET request which supports all header
settings:

See also

ClearRequestHeaders

GetRequestHeader

GetRequestHeaders

SetRequestHeaders


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x