HTTP Probe

A simple HTTP client.

Identification and Properties

Probe Type ID: tcp

Properties:

Name Type Default value Description
local_ip string (empty - system assigned) Local IP address to use when sending HTTP requests.
local_port integer 0 (system assigned) Local port to use when sending HTTP requests.
host string localhost The HTTP server’s hostname or IP address.
port integer 80 The HTTP server’s port.
version string HTTP/1.0 The HTTP version to use in requests.
protocol string http The HTTP variant:http or https. For now, only http is supported.
maintain_connection boolean False If set to True and HTTP version is 1.1, the probe keeps the tcp connection opened once a response has been received, until the server closes it.
connection_timeout float 5.0 The connection timeout, in s, when trying to connect to a remote party.

Overview

This probe acts as a simple HTTP client and is fully based on TCP Probe with HTTP codecs.

It can be used to connect to an HTTP server, send and receive requests at low-level. This client won’t follow HTTP redirections, enable authentication, or anything fancy. However, it is able to maintain the TCP connection between requests (set maintain_connection to True) and manageq a connection timeout to automatically fails the probe after a given delay (see the connection_timeout property).

For HTTPS connectivity, you should consider using TCP Probe with HTTP codecs as default codecs instead.

Availability

All platforms.

Dependencies

None.

See Also

Instead of using the probe, you may consider a TCP Probe with some HTTP codecs set as default encoder/decoders, which offer a greater control and support HTTPS as well (with use_ssl set to True).

TTCN-3 Types Equivalence

The test system interface port bound to such a probe complies with the HttpClientPortType port type as specified below:

type record HttpRequest
{
  charstring method optional, // default: 'GET'
  charstring url,
  record { charstring <header name>* } headers,
  charstring body optional, // default: ''
}

type record HttpResponse
{
  integer status,
  charstring reason,
  charstring protocol,
  record { charstring <header name>* } headers,
  charstring body,
}

type port HttpClientPortType
{
  in HttpRequest;
  out HttpResponse;
}