Set header

This is a pre-built action located under the WebService List Element. It instructs the Avo Assure Client to set a request header for the WebService request. This ensures that necessary HTTP headers (such as content type, authorization, etc.) are included in API call.

Syntax

Input Value: <Request_header>

Argument
Description

<Request_header> (Required)

Provide the request header that need to be included in the API request.

Note: You can provide multiple header key value pairs, with each header specified on a new step in the Input Value column.

Output Value: N/A

Argument
Description

N/A

Not Applicable

Example 1: Setting a Request Header in a WebService Request

In this example, we explain how to add a header to a WebService request.

  • Action: Set header

  • Input Value: Content-Type: application/json

    • The argument (Content-Type: application/json) specifies the key and value of the request header.

  • Output Value: N/A

    • This action does not require or store any output variable.

  • Logical Explanation: The Set header action takes the value from the Input Value column (Content-Type: application/json) and adds the specified header to the WebService request. The action assigns application/json as the value for the Content-Type request header.

Example 2: Setting Multiple Request Headers in a WebService Request

In this example, we explain how to add multiple headers to a WebService request.

  • Action: Set header

  • Input Value: Connection: true Content-Type: application/json X-vSRFTOKEN: 1YVIb63YPW6MU9CjGHQWxHM3FLM3KEFsAsjZular7XQALBhJgIBjxmZMIGZtKnzS

    • The first header step (Connection: true) specifies the connection behavior for the request.

    • The second header step (Content-Type: application/json) specifies that the request body is in JSON format.

    • The third header step (X-vSRFTOKEN: 1YVIb63YPW6MU9CjGHQWxHM3FLM3KEFsAsjZular7XQALBhJgIBjxmZMIGZtKnzS) specifies the security token used for request validation.

  • Output Value: N/A

    • This action does not require or store any output variable.

  • Logical Explanation: The Set header action reads each key value pair provided in the Input Value column and add them to the request header section. The action appends each header to the existing request headers before the WebService request is executed.

circle-info

Note: Provide each header on a separate step in the Input Value column, as shown in the screenshot. Each step is treated as a separate header and appended to the request before execution.

Last updated