# 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) | <p>Provide the request header that need to be included in the API request.</p><p><br><strong>Note</strong>: You can provide multiple header key value pairs, with each header specified on a new step in the <strong>Input Value</strong> column.</p> |

**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.

<figure><img src="https://2174257472-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fk8QZzXZMIJSStKAzDSTu%2Fuploads%2FW0pGJk03EK2A72KJ1CFJ%2Fimage.png?alt=media&#x26;token=f9bf13e4-93f8-4f42-b1b0-9736ff97c24b" alt=""><figcaption></figcaption></figure>

### **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.&#x20;

{% hint style="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.
{% endhint %}

<figure><img src="https://2174257472-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fk8QZzXZMIJSStKAzDSTu%2Fuploads%2Fwc0y0GD5AzJYjgk5LVQ3%2Fimage.png?alt=media&#x26;token=1e601f33-476e-4e5e-afd5-f5bc73856d02" alt=""><figcaption></figcaption></figure>
