Call REST Web Service

The Call REST Web Service action sends a request to a REST web service and returns the web service's response, which may be for instance XML, JSON or HTML. The response is either presented in HTML form as the current page or stored in a variable.

If the web service returns a fault, the message is not returned by the action. Instead, the action will generate an error which can be handled using the standard error handling mechanisms.

Properties

The Call REST Web Service action can be configured using the following properties:

URL

The base URL of the web service, excluding parameters. The URL can be specified in several ways using a URL Selector.

Request

Here, you specify the type of request to be made. REST supports four basic operations:

GET

Used for querying data. For GET requests, you can specify a number of parameters as name/value pairs. Click '+' to add a new parameter.

POST

Used for updating selected parts of data. For POST requests, you can either specify a number of parameters as name/value pairs or give the entire body of the request. If you specify the request with parameters, you must select whether to use POST (application/x-www-form-urlencoded) or MULTIPART (multipart/form-data) to encode the parameters. If you give the entire ('raw') body of the request, you must specify the content type of the request data.

For POST and PUT requests, MULTIPART encoding can be selected to enable file uploads. If a binary variable is selected as the value of a File Upload parameter, the bytes are submitted as-is. If Base 64 encoding is desired, the value of the parameter should be an expression base64Encode(data) where data is the name of the variable containing the binary value. In that case, it is also recommended to specify the value base64 as Content Transfer Encoding - otherwise, this field can normally be left blank.

Important
PUT

Used for replacing data. See POST for a description of the different ways of specifying a PUT request.

Delete

Used for deleting data. For DELETE requests, you can specify a number of parameters as name/value pairs. Click '+' to add a new parameter.

Accept

The content types that will be accepted as response. By default, any type of response will be accepted. The accepted content types can be specified in several ways using a Value Selector.

Encoding

The encoding that will be used to encode special characters in the request. The encoding used for decoding the response, is controlled using the step option, on the Page Loading Tab.

Output

Here, you select what happens to the output of the web service call.

Load in browser

The result is loaded into the current window, just as if it had been the result of a Load Page action. You may configure the behavior of the browser using the Options property described below.

Store in variable

The result is stored in the selected variable.

Options

Here you can override the robot's options with the step's own options. An option that is marked with an asterisk in the Options Dialog will override the one from the robot's configuration. All other options will be the same as specified for the robot.