Http Request

The “Http request” block is used to call a url with an http or https request and optionally use the response data. This can be useful in many scenarios, including retrieving test data from another system or sending data to a REST API endpoint.

See the HTTP Request lesson to see examples of how to monitor a web site and how to call a REST API.

Fully expanded, the “Http request” block looks like this:

http block

The Block Header (“Http Request”)

The green input connector in the header is used to trigger the block to start executing.

The green output connector in the header triggers when the http(s) request is completed, either successfully, with an error or after a timeout.

The title of the block (“Http request”) can be changed by double-clicking on it and typing in a new title.

Url

The url to perform the http(s) request against. For instance, https://leaptest.com. Right-click in the text and select “Insert token” to insert a field that has been added below.

Text fields (for Url)

Add any number of fields that can contain dynamic content and be used as tokens in the url.

Headers

A semicolon-delimited list of request headers. Right-click in the text and select “Insert token” to insert a field that has been added below.

Text fields (for Headers)

Add any number of fields that can contain dynamic content and be used as tokens in the headers.

Method

The request method. Supported methods include GET, POST, PUT and DELETE.

Body

For requests using the POST or PUT methods, the body is used to send data (such as forms data) along with the request.

Response

After the http(s) request is completed, the response property contains all information about the response. This includes the status code, response headers, body and how long it took to complete the request.

If the request fails, the response property will be empty.

Response Code

The http status code returned as a result of the request.

Response Headers

The semicolon-separated http headers returned as a result of the request.

Response Body

The response body (html, json, xml, etc) returned as a result of the request.

Response Time

The time in milliseconds from the request is sent until the last byte of the response was received.

Timeout

The maximum time spent waiting for the http(s) request to complete before giving up and triggering the green output connector (see above).

The default value is 10 seconds.

Examples of usage:

Author: Claus Topholt, August 5, 2016.