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

RESTClient object – PB Docs 2022 – PowerBuilder Library

RESTClient object – PB Docs 2022

RESTClient object

The RESTClient object provides the ability to access the RESTful Web
APIs. It loads the JSON-formatted string returned from the RESTful Web
Service APIs into the DataWindow object. The JSON string returned from the
RESTFul Web Service APIs must be in the format described in the section called “Supported JSON formats” in Application Techniques.

The RESTClient object supports compression for the downloaded data,
but not for the uploaded data. If the data received from the RESTful web
service is compressed, it will be automatically decompressed. Gzip and
Brotli compression formats are supported. The developer can use the
SetRequestHeader function to set the Accept-Encoding header to allow only
the gzip or br compression format.

Note

This object cannot be referenced in the .NET Assembly component,
otherwise the component will fail to be deployed.

Note

DataWindow object with the following presentation styles are
unsupported: Composite, Crosstab, OLE 2.0, and RichText.

Note

This object uses your computer’s proxy settings directly. It
currently does not support enabling/disabling the proxy settings or
configuring its own proxy.

Properties

RESTClient property

Datatype

Description

AnonymousAccess

Boolean

Whether to allow the client to access the server
anonymously.

CheckForServerCertRevocation

Boolean

Checks if the server certificate is
revoked.

EnableHttp2

Boolean

Whether to enable support for the HTTP2 connection
when sending requests.

IgnoreServerCertificate

Integer

Ignores certain error(s) of the server
certificate.

SecureProtocol

Integer

Specifies the security protocol.

TimeOut

Long

Specifies the timeout seconds.

ClassDefinition

PowerObject

An object of type PowerObject containing
information about the class definition of the object or
control

Events

RESTClient event

Occurs

Constructor

When the object is created

Destructor

When the object is destroyed

Functions

RESTClient function

Datatype returned

Description

ClassName

String

Returns the name assigned to the
object

ClearClientCert

Integer

Clears the client certificate that is set with
SetClientCert.

ClearRequestHeaders

Integer

Clears headers of the request.

GetContextService

Integer

Creates a reference to a context-specific instance
of the specified service.

GetHttpVersion

String

Gets the HTTP protocol version used in
communication.

GetParent

PowerObject

Returns a reference to the name of the parent
object.

GetJWTToken

Integer

Gets the JWT token using the POST
method.

GetOAuthToken

Integer

Gets the OAuth 2.0 access token.

GetRequestHeader

String

Gets the request header by name.

GetRequestHeaders

String

Gets all of the request headers
information.

GetResponseHeader

String

Gets the response header by name.

GetResponseHeaders

String

Gets all of the response headers
information.

GetResponseStatusCode

Long

Gets the response status code.

GetResponseStatusText

String

Gets the response status
description.

PostEvent

Boolean

Adds an event to the end of the message queue for
the object.

Retrieve

Long

Retrieves data to the DataWindow, DataWindowChild,
or DataStore from the RESTFul Web service.

RetrieveOne

Long

Retrieves one data row to the DataWindow,
DataWindowChild, or DataStore from the RESTFul Web service.

SendDeleteRequest

Integer

Sends the HTTP DELETE request to the server and
then gets the content of the server response.

SendGetRequest

Integer

Sends the HTTP GET request to the server and then
gets the content of the server response.

SendPatchRequest

Integer

Sends the HTTP PATCH request to the server and then
gets the content of the server response.

SendPostRequest

Integer

Sends the HTTP POST request to the server and then
gets the content of the server response.

SendPutRequest

Integer

Sends the HTTP PUT request to the server and then
gets the content of the server response.

SetClientCert

Integer

Sets the client certificate that will be used to
access the server.

SetJWTToken

Integer

Sets the JWT token string to the HTTP request
header which will be sent to the server.

SetOAuthToken

Integer

Sets the OAuth 2.0 token string to the HTTP request
header which will be sent to the server.

SetRequestHeader

Integer

Sets the request header.

SetRequestHeaders

Integer

Sets all of the request headers
information.

Submit

Integer

Sends the data to the server via the HTTP POST
method.

TriggerEvent

Integer

Triggers a specific event in the object and
executes the script for the event.

TypeOf

Object

Returns the type of the object.


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