> For the complete documentation index, see [llms.txt](https://docs.avoautomation.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.avoautomation.com/avo-assure/actions/web-service-operations/web-service-list/get-header-1.md).

# Get header

This is a pre-built Action located under the **WebService List** Element. The functionality of this action in Avo Assure is to fetch one or more response header key values after executing a webservice request and store the result in a dynamic variable.

## **Syntax**

**Input Value**: `<Header Key>`

{% hint style="info" %}
**Note:**

* If you do not enter a value in the **Input** **Value** column, the action saves the entire response header in the output variable.
* If you provide a specific header key, the action retrieves only the value of that key.
* You can fetch multiple header values by separating the header keys with a semicolon (;).
* Header keys are case-sensitive, so you must provide the correct key name.
  {% endhint %}

| Argument                            | Description                                           |
| ----------------------------------- | ----------------------------------------------------- |
| <p>\<Header Key> <br>(Required)</p> | Provide the specific key name of the response header. |

**Output Value**: `<Dynamic Variable>;<Dynamic Variable>(Optional)`

| Argument                                  | Description                                                                |
| ----------------------------------------- | -------------------------------------------------------------------------- |
| <p>\<Dynamic Variable> <br>(Required)</p> | This dynamic variable holds the header or its value.                       |
| <p>\<Dynamic Variable><br>(Optional)</p>  | This dynamic variable holds the execution status as **True** or **False**. |

### **Example 1: Retrieving a Specific Response Header**

In this example, we explain how to fetch a single response header value from an executed WebService request.

* **Action**: Get header
* **Input Value**: StatusCode
  * The input value (**StatusCode**) specifies the response header key to retrieve from the WebService response.
* **Output Value**: {S\_Code}
  * The first output variable (**{S\_Code}**) stores the retrieved header value as (**200**).
  * If a second output variable is provided, the action returns the status as **True** or **False**:
    * **True**: If the specified header is retrieved successfully.
    * **False**: If the header does not exist in the response.
* **Logical Explanation**: The **Get Header** action takes the value from the **Input Value** column (**StatusCode**) and searches for the matching header in the executed WebService response. After retrieving the header value (**200**), the action stores it in the **{S\_Code}** variable.

<figure><img src="/files/rJeK34CsnRfVRPoKEOy8" alt=""><figcaption></figcaption></figure>

### **Example 2: Retrieving Multiple Response Header Values**

In this example, we explain how to fetch multiple response header values from an executed WebService request.

* **Action**: Get header
* **Input Value**: StatusCode;Content-Type;Content-Length
  * The first argument (**StatusCode**) specifies the first response header key to retrieve.
  * The second argument (**Content-Type**) specifies the second response header key to retrieve.
  * The third argument (**Content-Length**) specifies the third response header key to retrieve.
* **Output Value**: {Values}
  * The output variable (**{Values}**) stores all retrieved header values in an array format (**\[200**, **'application/json'**, **'91902']**).
  * If a second output variable is provided, the action returns the status as **True** or **False**:
    * **True:** If all specified headers are retrieved successfully.
    * **False:** If one or more headers do not exist in the response.

{% hint style="info" %}
**Note**:

* To fetch a specific value from the list, use the [**Display Variable Value**](/avo-assure/actions/generic/variable-operations/display-variable-value.md) action and provide the input variable as **{Value\[0]}**.

* To fetch multiple values from the list, separate the variables with a semicolon (;). For example: **{Value\[0]};{Value\[1]}**.
  {% endhint %}

* **Logical Explanation**: The **Get header** action takes the values from the **Input Value** column (**StatusCode;Content-Type;Content-Length**) and retrieves the matching headers from the executed WebService response. The action stores all retrieved header values in the **{Values}** array variable as (**\[200**, **'application/json'**, **'91902']**).

<figure><img src="/files/pr2tsxDMc9XJsDx5ZCfp" alt=""><figcaption></figcaption></figure>

* **To fetch a single header value from the give header keys, refer to the screenshot below.**

<figure><img src="/files/6qwIGu7ScjDCdxanS5DL" alt=""><figcaption></figcaption></figure>

* **To fetch multiple header values from the give header keys, refer to the screenshot below.**

<figure><img src="/files/ZyuRZliKCi7tKZLrLGvd" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.avoautomation.com/avo-assure/actions/web-service-operations/web-service-list/get-header-1.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
