The RESTClient object is built on top of the HTTPClient object; and it does not have as many advanced features as HTTPClient.
RESTClient is a simple API client that is suitable for making requests to RESTful Web Service APIs with simple, flat response data (such as a string or a JSON). It can load the JSON-formatted string returned from the APIs into the DataWindow object. The JSON string returned from the 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
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.
Note
RESTClient (as well as HTTPClient, CrypterObject, CoderObject, CompressorObject, DotNetAssembly, JSONGenerator, JSONParser, JSONPackage, OAuthClient, PDF Builder objects, SMTPClient, PowerServerLabel, PowerServerResult) does not support multi-threading.
RESTClient property |
Datatype |
Description |
---|---|---|
Boolean |
Whether to allow the client to access the server anonymously. |
|
Boolean |
Checks if the server certificate is revoked. |
|
Boolean |
Whether to enable support for the HTTP2 connection when sending requests. |
|
Integer |
Ignores certain error(s) of the server certificate. |
|
Integer |
Specifies the security protocol. |
|
Long |
Specifies the timeout seconds. |
|
ClassDefinition |
PowerObject |
An object of type PowerObject containing information about the class definition of the object or control |
RESTClient function |
Datatype returned |
Description |
---|---|---|
String |
Returns the name assigned to the object |
|
Integer |
Clears the client certificate that is set with SetClientCert. |
|
Integer |
Clears headers of the request. |
|
Integer |
Creates a reference to a context-specific instance of the specified service. |
|
String |
Gets the HTTP protocol version used in communication. |
|
PowerObject |
Returns a reference to the name of the parent object. |
|
Integer |
Gets the JWT token using the POST method. |
|
Integer |
Gets the OAuth 2.0 access token. |
|
String |
Gets the request header by name. |
|
String |
Gets all of the request headers information. |
|
String |
Gets the response header by name. |
|
String |
Gets all of the response headers information. |
|
Long |
Gets the response status code. |
|
String |
Gets the response status description. |
|
Integer |
Gets the currently supported authentication scheme. |
|
Boolean |
Adds an event to the end of the message queue for the object. |
|
Long |
Retrieves data to the DataWindow/DataWindowChild/DataStore from the RESTFul Web service. |
|
Long |
Retrieves one data row to the DataWindow/DataWindowChild/DataStore from the RESTFul Web service. |
|
Integer |
Retrieves or updates data for more than one DataWindow/DataWindowChild/DataStore using the .NET DataStore Web API. Commit changes to the database automatically if all succeed; otherwise roll back all of the changes if any DataWindow failed. |
|
Long |
Retrieves data for one DataWindow/DataWindowChild/DataStore using the .NET DataStore Web API. |
|
Integer |
Sends the HTTP DELETE request to the server and then gets the content of the server response. |
|
Integer |
Sends the HTTP GET request to the server and then gets the content of the server response. |
|
Integer |
Sends the HTTP PATCH request to the server and then gets the content of the server response. |
|
Integer |
Sends the HTTP POST request to the server and then gets the content of the server response. |
|
Integer |
Sends the HTTP PUT request to the server and then gets the content of the server response. |
|
Integer |
Sets the client certificate that will be used to access the server. |
|
Integer |
Sets the current authentication credentials. |
|
Integer |
Sets the JWT token string to the HTTP request header which will be sent to the server. |
|
Integer |
Sets the OAuth 2.0 token string to the HTTP request header which will be sent to the server. |
|
Integer |
Sets the request header. |
|
Integer |
Sets all of the request headers information. |
|
Integer |
Sends the data to the server via the HTTP POST method. |
|
Integer |
Triggers a specific event in the object and executes the script for the event. |
|
Object |
Returns the type of the object. |
|
Integer |
Updates data for one DataWindow/DataWindowChild/DataStore using the .NET DataStore Web API. Commit changes to the database automatically if succeed, otherwise, roll back the changes automatically. |