HTTP Tests


The following example retrieves the HTTP response code of an HTTP call.

$ curl

Exemple HTTP code

HTTP modes and sub-tests#

Execute HTTP requests with the Tornado HTTPClient class. The probe has several modes:

Mode Description
code default Returns the HTTP response code.
substr Allows the use of regular expression to extract information from the response body.
json Parses the response body as JSON and allows looking for a value trough the object.
header Returns the specified header of the response.
duration Returns the execution time of the request.
geoduration Returns the execution time of the request by querying multiple DNS servers for the geographic zone.

All parameters of the tornado.httpclient.HTTPRequest constructor are valid and can be used as arguments when submitting an http test. For convenience the mostly used are listed in the table below along with some extensions:

Parameter Description
regex string Regular expression to match against the response body. Used in substr mode.
path or property string The path to a value within an object. Used in json mode. Ex: servers[0].interfaces[0].ip_address would extract the value of the field ip_address.
header string Extract specific header from the response object. Used in header mode.
onecurl_id UUID References OneCurl object to get request parameters from.
follow_redirects 1 or 0 Allow request to follow the redirect. By default 1
validate_cert 1 or 0 Ask to validate the SSL certificate. By default 1


The following example retrieves the Content-Type header of an HTTP response.

$ curl'