Enhanced RESTClient object
The following three new functions are added to the RESTClient
object:
-
Submit — Sends data from the client application to a RESTful
Web service.The data to be submitted may be from either a DataWindow,
DataStore, DataWindowChild, or JSONPackage. You can specify one or
multiple DataWindow buffers, and also the range in the DataWindow,
from which to submit the data. The request supports OAuth 2.0
authorization.See the section called “Submit” in PowerScript Reference for more details.
-
SendRequest — Sends the request from the RESTClient object to
the server.Previously only the HTTPClient object supports sending a request
to the RESTful web service. Now you can directly send a request from
the RESTClient object, and the request supports OAuth 2.0
authorization.See the section called “SendRequest” in PowerScript Reference for more details.
-
GetResponseBody — Gets the response body into a string or blob
value.This function gets the response of the SendRequest function 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.See the section called “GetResponseBody” in PowerScript Reference for more details.
The following function is enhanced:
-
Retrieve – 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. You can use the SetRequestHeader
function to set the Accept-Encoding header to allow only the gzip
compression format.