response, status, code, api, request, response, send, soap, rest, get, post, put, delete

Method GetResponseStatusCode

API

Returns HTTP Status Code

Watch this video to learn how to use this method

Have a problem with playback?
GetResponseStatusCode returns HTTP status code. So the output is the status code number. Let's do simple method request - execute method. Then output to the messagebox the GetResponseStatusCode. Run - and we can see the status code is 200 meaning response is OK Cange API server address to the wrong one and repeat the scenario We can see that status code is 404 - server not found, just as expected to be.

Usage

Function GetResponseStatusCode(
  Boolean Report [Optional]
)

Method

ZAP API Method step

GetResp...Code

True

code

Report

Output Parameter

Parameters

Report (optional)

Type: Boolean

Default Value: False

Generate report for this step

Returns

Status Code

Example

VBScript

Server("API Server").Method("Method").Execute
' Check status code
msgbox Server("API Server").Method("Method").GetResponseStatusCode(True)

JavaScript

Server("API Server").Method("Method").Execute();
// Check status code
alert(Server("API Server").Method("Method").GetResponseStatusCode(true));

Method

ZAP API Method step

Execute

Script-Less next step

Comment

Check status code

Script-Less next step

Method

ZAP API Method step

GetResp...Code

True

code

Contact Us

3150 Roswell Rd NW

Atlanta, GA, 30305, USA

(800) 795-3552