CoAP Protocol Support Plugin


The CoAP Protocol Support Plugin adds a new test step to Ready! API that allows you to make a request using the Constrained Application Protocol (CoAP). The test step is similar to other request test steps of Ready! API and has the expected request test step features (including assertions). The current version of the plugin supports block-wise transfers but does not support DTLS-Secured CoAP and does not observe requests completely because observing resources are still not a part of the protocol standard.

The CoAP Request test step

A sample of the CoAP Request test step editor is below:


The top area of the editor contains the following elements:

  • Method: operation under the CoAP resource. CoAP supports 4 methods: GET, POST, PUT, and DELETE.

  • Request endpoint: URI of a requested CoAP resource, which should start with the protocol name: “coap://”

  • Confirmable request: if checked, the request will be sent as a CON message (this type of message requires an acknowledgement that it arrived). If not checked, it will be sent as a non-confirmable (NON) message.

The main area of the editor is divided into two parts: the left part allows you to customize the request you are sending, the right part contains the received response as a result of the test step execution. In the Response Panel, you can see your CoAP response on the following tabs:

  • Outline: allows to edit the request payload in the tree view mode (it can be useful for POST and PUT requests which have XML or JSON format for the payload);

  • CoAP: this is a main page which has the all request customizations (see details below);

  • Raw: contains the payload of the sent request in textual form (i.e. it is filled after the request is sent).

The response part contains the following pages:

  • Overview, Outline: try to show a response payload as a tree (in case it contains XML or JSON);

  • JSON, XML: try to show a response payload as JSON and XML respectively;

  • HTML: tries to show a response payload as a webpage;

  • CoAP: this is a main page which displays response code, message type, options and payload in a text form.

The CoAP page of the request part


It has the following sections:

  • Query parameters: allows you to specify the parameters which are appended to a CoAP resource URI after a ? character when submitting a request (although URI is actually sent using Uri-* options in CoAP)

  • Request options: allows you to specify CoAP options for a request. In order to add a new option, click OK, which will show the Add an option dialog:


You can add both standard and custom options. Choose one of the standard options (allowed for requests) from the popup list or type the number of a custom option in the Option field as a decimal number (a hexadecimal number starting from “0x” characters is also permitted). The format of the value depends on the option; note that some options do not require a value at all and the Value field is disabled.

Accept, Content-Format

Please choose a known media-type from the popup list or type the decimal number of a custom media-type (a hexadecimal number starting from “0x” characters is also permitted)

ETag, If-Match, custom options

A string or a hexadecimal digits sequence starting from “0x” characters. Property expansion is allowed (for a hexadecimal digits sequence as well)

Size2, If-None-Match

Do not require a value


Decimal number (a hexadecimal number starting from “0x” characters is also permitted)


Please choose preferred block size from the combo-box


  • Request Payload: this section contains a memo which allows you to input a payload of the request. The Content format combo-box specifies a media-type of a request body (it duplicates a Content-Format option value in the Request Options section). Beside standard media-types, you can type a decimal number of a custom media-type in this combo-box (a hexadecimal number starting from “0x” characters is also permitted). Note that a hexadecimal number sequence should be specified for binary media types (such as application/octet-stream). In the case when a custom media-type is specified, the plugin interprets the memo content as a hexadecimal digits sequence if it starts from “0x” characters and as a text otherwise.


Properties in the Properties Panel


COAP Request Properties

Name – the test step’s name.
Auto Size1 Option – if it is true, the Size1 option will be added to a request, and its value will be equal of size of a payload in bytes.
Multi-Value Delimiter - A request endpoint URI can include several query parameters having the same name. This property specifies the delimiter that will be used for the values in the editor.
Send Empty Parameters - Specifies whether Ready! API will send empty values in the URI parameters of the request.
Timeout - Specifies the number of milliseconds to wait for a response. If the property value is 0 or is not specified, the wait time is infinite.

Custom Properties

Endpoint – the target URI (the same as Request endpoint  in the test step editor).
Request – request payload.
RawRequest – same as  Request.
Response – the payload of last received response.
ResponseAsXml – a response payload as an XML DOM document (if possible).
ResponseETag – contains ETag option value of the last received response. (The subsequent test steps can use this value in ETag and If-Match request options using property expansion mechanism of Ready!API).
ResponseLocation – contains concatenation of Location-Path and Location-Query options of the last received response which is the location of the resource created as the result of a POST request. (The subsequent test steps can refer to this resource using property expansion mechanism of Ready!API).
The Custom Properties page may also contain properties which correspond to query parameters specified in the test step editor.

CoAP log


The plugin also adds the CoAP log page to the Logs panel of Ready!API. All CoAP traffic sent or received is posted there. (This tab is shown only if at least one CoAP request was submitted)


Block-wise transfers


The plugin handles block-wise message exchange transparently. If block-wise transfer is required, a test step execution is completed only after all request blocks are sent and all response blocks are received. In this case response payload is actually a concatenation of payloads of all response messages and response options are in fact options of a last received message. The plugin also initiates block-wise request body transfer automatically if a request payload is more than 1Kbyte length.