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

Method GetHeaderValueByIndex

API

Returns response header value by index

Watch this video to learn how to use this method

Have a problem with playback?
GetHeaderValueByIndex 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 GetHeaderValueByIndex(
  String HeaderName,
  Integer Index,
  Boolean Report [Optional]
)

Method

ZAP API Method step

GetHe...ByIndex

Server

2

True

headerValue

HeaderName

Index

Report

Output Parameter

Parameters

HeaderName

Type: String

Header Name

Index

Type: Integer

Index

Report (optional)

Type: Boolean

Default Value: False

Generate report for this step

Returns

Header Value

Example

VBScript

Server("API Server").Method("Method").Execute
' Execute method should be called before get header value
headerValue = Server("API Server").Method("Method").GetHeaderValueByIndex("Server", 2, True)

JavaScript

Server("API Server").Method("Method").Execute();
// Execute method should be called before get header value
var headerValue = Server("API Server").Method("Method").GetHeaderValueByIndex("Server", 2, 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

GetHe...ByIndex

Server

2

True

headerValue

Contact Us

1425 Market Blvd Suite 530-230

Roswell, GA 30076, USA

(800) 795-3552