Method HasResponse

Checks if methos has a ready response

Usage

Function HasResponse()

GetBookById

ZAP API Method step

HasResponse

Parameters

This method does not take parameters

Returns

True if response is not null

Example

VBScript

' Execute method if doesn't have response and get string response
If NOT Server("API Server").Method("GetBookById").HasResponse() Then
    Server("API Server").Method("GetBookById").Execute
End If
msgbox Server("API Server").Method("GetBookById").GetStringResponse()

JavaScript

// Execute method if doesn't have response and get string response
if (!Server("API Server").Method("GetBookById").HasResponse()) {
    Server("API Server").Method("GetBookById").Execute();
}
alert(Server("API Server").Method("GetBookById").GetStringResponse());

GetBookById

ZAP API Method step

HasResponse