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

SetHttpRequestHeader – PB Docs 2022 – PowerBuilder Library

SetHttpRequestHeader – PB Docs 2022

SetHttpRequestHeader

PowerScript function

Description

Sets the HTTP request header. This function is only used for
PowerServer and the request header that is set using this function is used
only when PowerServer API calls are being made.

Applies to

Application
object

Syntax

Argument

Description

applicationname

The name of the application 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 1) TRUE is recommended
when you specify the charset in the “Content-Type” header,
because no more than one charset is allowed; 2) FALSE is
recommended when cookie is used.

Return value

Integer.

Returns 1 if it succeeds and -1 if an error occurs or if the current
application is not an installable cloud app deployed with PowerServer. If
any argument’s value is null, the method returns null.

Examples

The following code example sets the access token in the HTTP request
header:

The following code example sets the cookie in the HTTP request
header:

Notice that you can only set the cookie name and cookie value in the
key-value pairs (for example, “key1=value1; key2=value2”), and cannot set
the other properties such as Domain, Expires etc.

See also

BeginSession

GetHttpResponseHeaders

GetHttpResponseStatusCode

GetHttpResponseStatusText


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