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 .
The Pure HTTP tasks implements support for HTTP/1.1 and HTTP/2. See Protocol Support and Features for more details.
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:
A simple sequence of tasks to send synchronous HTTP requests looks something like:
When sending asynchronous tasks, it is similar, but here we have to use another task (HttpAsynchWaitForResponseTask) to wait for the responses. For example:
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 client simulation is supported. See Protocol Support and Features for more details.
Client tasks
Server tasks
WebSocket tasks
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.
Task used to initiate HTTP and Proxy authentication. Must be used after HttpInitTask and before other HTTP tasks in a scenario.
Task used to set HTTP or Proxy information. Must be used after HttpInitTask and before other HTTP tasks in a scenario.
This task is used to initiate SSL options. Must be used after HttpInitTask and before other HTTP tasks in a scenario.
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.
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.
Task used to wait for a response to an asynchronous HTTP requests.
Task to set headers to be used by HTTP tasks following this task (in the same scenario).
Task used to create a request content body and saved using a named attribute. Content type and content are specified using task parameters.
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.
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.
Task used to create a multipart content body as specified by RFC 2387. Generated content body is saved using a named attribute.
Task used to close connection(s) created in current scenario.
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.
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.
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.
Task used to return a specified HTTP response.
Task is used to verify a received request.
Task is used to close and stop HTTP Server.
Task used to initiate HTTP WebSocket client used by HTTP WebSocket tasks following this task. Must be used after HttpInitTask in a scenario.
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.
Task used to wait for data data over HTTP WebSocket.
Task used to send ping message over HTTP WebSocket and wait for pong response.
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.