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

Method CheckHeaderValue

API

Checks Header with a Given value

Watch this video to learn how to use this method

Have a problem with playback?
CheckHeaderValue compares the header and it's value with the input parameters that user provides for this method Prior to use this function you need to insert Execute method. The input parameters for this method are response header name and header value. Third input parameter is optional boolean report defining whether or not report this step to script results. The output is boolean - true if the header name matches the header value and false if not. We know that for header "Server" the value is "Microsoft-HTTPAPI/2.0" so let's make it as an input parameters. We will use messagebox to demonstrate the output. The output shows true - the name and value matches. Let's change the header value to the different one Run the method - and we can see that the output is False now.

Usage

Function CheckHeaderValue(
    String HeaderName,
    String Value,
    Boolean Report [Optional]
)

Method

ZAP API Method step

CheckH...Value

Server

Apache/2.4.1

True

HeaderName

Value

Report [Optional]

Parameters

HeaderName

Type: String

Header Name

Value

Type: String

Value

Report (optional)

Type: Boolean

Default value: True

Report Result

Returns

True if header value matches value parameter

Example

VBScript

Server("API Server").Method("Method").Execute
' Execute method should be called before check header value
headerValue = Server("API Server").Method("Method").CheckHeaderValue("Server", "Apache/2.4.1")

JavaScript

Server("API Server").Method("Method").Execute();
// Execute method should be called before check header value
var headerValue = Server("API Server").Method("Method").CheckHeaderValue("Server", "Apache/2.4.1");

Method

ZAP API Method step

Execute

Script-Less next step

Comment

Execute method should be called before get header value

Script-Less next step

Method

ZAP API Method step

CheckH...Value

Server

Apache/2.4.1

True

Contact Us

1425 Market Blvd Suite 530-230

Roswell, GA 30076, USA

(800) 795-3552