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

Syntax – PB Docs 2018 – PowerBuilder Library

Syntax – PB Docs 2018

Syntax

Description

Retrieves data to the DataWindow, DataWindowChild, or DataStore
from the RESTFul Web service. If the data received from the RESTful web
service is compressed as gzip, it will be automatically decompressed.
Only gzip compression format is supported at this moment. The developer
can use the SetRequestHeader function to set the Accept-Encoding header
to allow only the gzip compression format.

Applies to

RestClient object

Syntax

Argument

Description

objectname

A reference to the RestClient
object.

dwControl

The name of the DataWindow control, DataStore, or
child DataWindow.

urlName

A string whose value is the URL.

data (optional)

A string or blob data. If this argument is not
specified, the retrieve function sends the request to the server
with “GET” method, otherwise with “POST”.

tokenrequest (optional)

A reference to the TokenRequest object for
supporting oAuth 2.0.

Usage

The JSON string returned from the RESTFul Web service APIs must be
in this format.

The RESTClient Retrieve function is not supported in
DataWindow/DataWindowChild/DataStore with the following presentation
styles: Composite, Crosstab, OLE 2.0, and RichText.

Although the RESTClient Retrieve function is not supported in the
Composite DataWindow, you can call GetChild function to get the child
DataWindow from the Composite DataWindow, and then call the Retrieve
function to retrieve the data into the child DataWindow.

Return value

Long.

Returns values as follows. If any argument’s value is null, the
method returns null.

>=0 — Returns the number of rows if it succeeds

-1 — General error

-2 — Invalid URL

-3 — Cannot connect to the Internet

-4 — Timed out

-5 — Get token error

-7 — Failed to decompress the response body

Example 1

This example retrieves data to a DataWindow:

Example 2

This example retrieves data to a DataStore:

Example 3

This example retrieves data to a DataWindowChild:

Example 4

This example passes the string data using POST method and
retrieves data to a DataWindow.

Example 5

This example passes the blob data using POST method and retrieves
data to a DataWindow.

Example 6

This example passes the string data using POST method and
retrieves data to a DataStore.

Example 7

This example passes the blob data using POST method and retrieves
data to a DataStore.

Example 8

This example passes the string data using POST method and
retrieves data to a DataWindowChild.

Example 9

This example passes the blob data using POST method and retrieves
data to a DataWindowChild.

Example 10

This example gets data from a Web site with token authentication
and then retrieves data to a DataWindow.

Example 11

This example passes the blob data using POST method and retrieves
the data from the Web site with token authentication to the
DataWindow.

Example 12

The client sends the server a request which includes the “gzip”
compression method; then the server compresses and returns the data as
requested; and then the client automatically extracts the data.


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