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

Method GetRequestHeader

API

Gets Request Header value which was set manually by user

Watch this video to learn how to use this method

Have a problem with playback?
GetRequestHeader returns request header value The input parameter is string Name The output is string Value or empty if the name not presented Let's use ConcatArrayData API method. We can see there is one record in the headers list Let's output the value to the messagebox Input should be "Header test" Run and we can see output is "abc" as expected.

Usage

Function GetRequestHeader(
    String Name
)

GetBookById

GetReq...Header

HeaderName

Name

Parameters

Name

Type: String

The name of the Header

Returns

Header value or Empty string if Header is absent

Example

VBScript

Server("API Server").Method("GetBookById").SetRequestHeader "Test", "Unknown header"
' Display header value in message box
msgbox Server("API Server").Method("GetBookById").GetRequestHeader("Test")

JavaScript

Server("API Server").Method("GetBookById").SetRequestHeader("Test", "Unknown header");
// Display header value in message box
alert(Server("API Server").Method("GetBookById").GetRequestHeader("Test"));

GetBookById

SetReq...Header

Test

Unknown header

Comment

Display header value in message box

Variable

header

GetReq...Header

Test

ZAP Utility

Zap.Comm...Box

Zap.Var...header")

Contact Us

Tower Place 100

3340 Peachtree Rd NE #1800 

Atlanta, GA 30326 USA

(404) 814-5227