For the complete documentation index, see llms.txt. This page is also available as Markdown.

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>

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.

Argument
Description

<Header Key> (Required)

Provide the specific key name of the response header.

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

Argument
Description

<Dynamic Variable> (Required)

This dynamic variable holds the header or its value.

<Dynamic Variable> (Optional)

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.

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.

Note:

  • To fetch a specific value from the list, use the Display Variable Value 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]}.

  • 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']).

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

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

Last updated