PureHTTP Tasks

Version 1.2

This document describes the Pure HTTP Tasks, provided as custom tasks that must be installed with PureLoad/PureTest on each installation using these tasks.

Before you use the tasks, read more about installing and how to load custom tasks .

HTTP Protocol Support

The Pure HTTP tasks implements support for HTTP/1.1 and HTTP/2. See Protocol Support and Features for more details.

Task overview

Pure HTTP tasks use the same tasks for HTTP/1.1 and HTTP/2. What protocol to be used is specified in the HttpInitTask.

HTTP requests are always sent by:

  • HttpTask – to send synchronous HTTP requests
  • HttpAsynchTask – to send asynchronous HTTP requests (without waiting for response)

A simple sequence of tasks to send synchronous HTTP requests looks something like:

  • HttpInitTask – to initiate the HTTP client
  • HttpTask – to send HTTP request and wait for response
  • HttpTask – to send HTTP request and wait for response
  • HttpCloseTask – to close all connections

When sending asynchronous tasks, it is similar, but here we have to use another task (HttpAsynchWaitForResponseTask) to wait for the responses. For example:

  • HttpInitTask – to initiate the HTTP client
  • HttpAsynchTask – to send HTTP request
  • HttpAsynchTask – to send HTTP request
  • HttpAsynchWaitForResponseTask – to wait for HTTP response
  • HttpAsynchWaitForResponseTask – to wait for HTTP response
  • HttpCloseTask – to close all connections

In addition there are tasks to initialize POST content, authentication, proxies, TLS, etc. Also take a look at the example PLC files provided in the test/purehttp directory.

WebSocket Support

WebSocket client simulation is supported. See Protocol Support and Features for more details.


Provided tasks

Client tasks

Server tasks

WebSocket tasks


HttpInitTask

Task used to initiate HTTP client and set common HTTP parameters used by HTTP tasks following this task. If authentication, proxy or SSL is used see HttpInitAuthTask, HttpInitProxyTask and HttpInitSslTask.


HttpInitAuthTask

Task used to initiate HTTP and Proxy authentication. Must be used after HttpInitTask and before other HTTP tasks in a scenario.


HttpInitProxyTask

Task used to set HTTP or Proxy information. Must be used after HttpInitTask and before other HTTP tasks in a scenario.


HttpTask

Task used to send synchronous HTTP requests and wait for response. Supports HTTP methods OPTIONS, GET, HEAD, POST, PUT, PATCH or DELETE.

If a request is to be sent using a request body this must be defined before this task using HttpRequestBodyTask, HttpRequestBodyFileTask or HttpRequestBodyFormDataTask. The attribute specifying the content is specified using a task parameter.


HttpAsynchTask

Task used to send asynchronous HTTP requests. To get and wait for a response, use HttpAsynchWaitForResponseTask. Supports HTTP methods OPTIONS, GET, HEAD, POST, PUT, PATCH or DELETE.

If a request is to be sent using a request body this must be defined before this task using HttpRequestBodyTask, HttpRequestBodyFileTask or HttpRequestBodyFormDataTask. The attribute specifying the content is specified using a task parameter.


HttpAsynchWaitForResponseTask

Task used to wait for a response to an asynchronous HTTP requests.


HttpHeaderTask

Task to set headers to be used by HTTP tasks following this task (in the same scenario).


HttpRequestBodyTask

Task used to create a request content body and saved using a named attribute. Content type and content are specified using task parameters.


HttpRequestBodyFileTask

Task used to create a request content body from file and saved using a named attribute. Content type and file path are specified using task parameters.


HttpRequestBodyFormDataTask

Task used to to create a multipart form content body as specified by RFC 7578 using content type “multipart/form-data”. I.e what is typically used when an HTML form is submitted by a client. Generated content body is saved using a named attribute.


HttpRequestBodyMultiPartTask

Task used to create a multipart content body as specified by RFC 2387. Generated content body is saved using a named attribute.


HttpCloseTask

Task used to close connection(s) created in current scenario.


HttpServerInitTask

Task used to initiate and start HTTP Server, used by HTTP Server tasks following this task.

If the server is shared, this task will only be executed once.


HttpServerPublishTask

Task is used to publish a handler that waits for a specified HTTP request and send a specified HTTP response when we have a match. This will be dome in background without any tasks being executed.


HttpServerWaitTask

Task used to wait for a specified HTTP request. The task blocks until HTTP request with specified Method, URL and/or content is received. Should be followed by HttpServerResponseTask to send response.


HttpServerResponseTask

Task used to return a specified HTTP response.


HttpServerRequestVerifyTask

Task is used to verify a received request.


HttpServerCloseTask

Task is used to close and stop HTTP Server.


HttpWebSocketInitTask

Task used to initiate HTTP WebSocket client used by HTTP WebSocket tasks following this task. Must be used after HttpInitTask in a scenario.


HttpWebSocketPingTask

Task used to send data over HTTP WebSocket. By default text data is used but to send binary data start data with “0x” followed by data in hexadecimal format.


HttpWebSocketWaitForMessageTask

Task used to wait for data data over HTTP WebSocket.


HttpWebSocketSendTask

Task used to send ping message over HTTP WebSocket and wait for pong response.


HttpWebSocketCloseTask

Task used to close WebSocket by sending a close message over HTTP WebSocket and wait for response. WebSocket is closed after the close message is received from the server.

About Emblasoft

From innovation, to validation and smooth operation, our solutions help operators and equipment vendors deliver outstanding services and performance to their customers.

Emblasoft Test & Measurement AB
Hammarby allé 29
120 32 Stockholm, Sweden

Send us an email: contact@emblasoft.com

  • Linkedin
  • Twitter
Ready to talk to us?