header, value, api, request, response, send, soap, rest, get, post, put, delete

Method GetHeaderValues

API

Returns array of response header values by header name

Watch this video to learn how to use this method

Have a problem with playback?
GetHeaderValues method provides you the value of data storing below the given header. Prior to use this function you need to insert Execute method. The input of this method is a name of the header. The output is the string data value. To check what headers suitable for current API method you can use GetHeaderNames function first. Let's see what is the value of "Date" header. We will use messagebox to demonstrate the output. We can see that the correct date and time is the value of the "Date" header.

Usage

Function GetHeaderValues(
  String HeaderName,
  Boolean Report [Optional]
)

Method

ZAP API Method step

GetHeaderValues

Server

True

headerValues

HeaderName

Report

Output Parameter

Parameters

HeaderName

Type: String

Header Name

Report (optional)

Type: Boolean

Default Value: False

Generate report for this step

Returns

Header Values String Array

Example

VBScript

Server("API Server").Method("Method").Execute
' Execute method should be called before getting header values
headerValues = Server("API Server").Method("Method").GetHeaderValues("Server", True)

JavaScript

Server("API Server").Method("Method").Execute();
// Execute method should be called before getting header values
var headerValues = Server("API Server").Method("Method").GetHeaderValues("Server", true);

Method

ZAP API Method step

Execute

Script-Less next step

Comment

Execute method should be called before get header value by index

Script-Less next step

Method

ZAP API Method step

GetHeaderValues

Server

True

headerValues

Contact Us

1425 Market Blvd Suite 530-230

Roswell, GA 30076, USA

(800) 795-3552