as of release 3.27 | prior to release 3.27 |
---|---|
Function
This object is used to make a REST call to a web service.
Programming Experience Required
Note: you will require programming experience to use this object. jtel does not provide developer support as part of the standard support contract.
The object can perform the following type of REST calls:
- GET
- POST
- PUT
- DELETE
It is possible to specify parameters, which are coded in the URL. Also it is possible to specify additional headers which will be sent with the http headers when the REST call is made.
When POST or PUT operations are performed, data can be specified which is sent in the content of the http request.
When the call returns, the headers from the response are provided as variables which can be used in the application at a later step. The response body is parsed if valid XML or JSON, and is also provided as variables. It is possible to specify a prefix for the result (which includes the headers), and a separate prefix for the content variables provided.
Parameters
Parameter | Purpose | ||||||||||
Object Name | The name of this object instance | ||||||||||
Request Method | Choose the http request method to be used. GET, POST, PUT and DELETE are supported. | ||||||||||
Headers | Any number of headers can be specified and will be sent with the http request. Headers must be specified separated by \n, if more than one header will be used. For example: my-header-1: value1\n | ||||||||||
Parameters | Parameters are passed at the end the URL, in the form: http(s)://url?param1=value1¶m2=value2 The parameters will automatically be URL encoded as required. | ||||||||||
Data | Data is only required for POST or PUT operations. The data is passed as defined by the Content-Type parameter. | ||||||||||
Content-Type | This parameter is passed as the http header "Content-Type", and defines how the data included in the POST or PUT request will be encoded. Currently supported are: application/json | ||||||||||
Variable Prefix Content | If the web service returns content with the http response, then this will be provided as follows:
The exact format provided will depend on the exact structure returned. You should use the Variable Dump Object to examine the exact variables which are parsed. Example:
| ||||||||||
Variable Prefix Result | The headers and the http status line and status code are stored in variables prefixed with the value provided here. The following variables are provided automatically (assuming a valid http response):
Example:
|
Outputs
Output | Used when ... |
200 OK | A 200 OK response was received from the http Server. |
Other | Any other response was received from the http Server. |
Error | An error occurred. No response, or an incorrect response was received from the http Server. |
Variables Provided
Prefix is replaced with the prefix specified in the object definition.
Variable | Contains |
resultPrefix.httpResponseCode | The http response code. |
resultPrefix.httpResponse | The http response. |
resultPrefix.responseData | The http content. |
resultPrefix.command | The CURL command used for reference / debugging. |
resultPrefix.* | Other http headers provided by the web service. |
contentPrefix.* | Parsed variables from a valid JSON or XML response. |