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

Method SetRequestHeader

API

Sets Request Header value

Watch this video to learn how to use this method

Have a problem with playback?
SetRequestHeader sets request header name and value during the runtime The input parameters are string Name and string Value Let's add a header item to the ConcatArrayData method The name will be "Header test" and the value will be "abc" We will set breakpoint to pause the script execution. Run and we can see new entry appears in the Headers list accorging to our command.

Usage

Function SetRequestHeader(
    String Name,
    String Value
)

GetBookById

SetReq...Header

Test

Unknown...

Name

Value

Parameters

Name

Type: String

The name of the Header

Value

Type: String

The new value to set (must be a string)

Returns

No return value

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