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

GetJWTToken – PB Docs 2019 – PowerBuilder Library

GetJWTToken – PB Docs 2019

GetJWTToken

PowerScript function

Description

Gets the JWT token using the POST method.

Applies to

RESTClient objects

Syntax

Argument

Description

objectname

The name of the RESTClient object from which you want to
get the JWT token.

urlName

A string value specifying the URL.

data

A string value specifying the data to send.

If the user sets the encoding charset in the Content-Type
request header, this function will encode the data with the
specified charset; if charset is not specified, this function
will encode the data in UTF-8 by default.

token

The server response which contains the access
token.

If RESTClient failed to send request or server provides no
response, the response value is an empty string. If the response
value is compressed as gzip, it will be automatically
decompressed. Only gzip compression format is supported at this
moment. If the server specified the Content-Type response
header, and in which the encoding charset is specified, this
function will encode the data with the specified charset; if
charset is not specified, this function will encode the data in
UTF-8 by default.

Return value

Integer. Returns 1 if the function succeeds and a negative value if
an error occurs. If any argument’s value is null, the method returns
null.

1 — Success

-1 — General error

-2 — Invalid URL

-3 — Cannot connect to the Internet

-4 — Timeout

-5 — Failed to get token.

-7 — Failed to decompress data

-14 — Code conversion failed

-15 — Unsupported character set

Example 1

The following code example gets the data that requires JWT token
authentication.

Example 2

The following code example gets the data that requires JWT token
authentication.

See also

SetJWTToken


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