Method HasResponse
Checks if methos has a ready responseUsage
Function 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());
Documentation Categories
![](https://www.zaptest.com/wp-content/uploads/2022/02/1SCRIPT_STEP.jpg)
ZAPTEST
![](https://www.zaptest.com/wp-content/uploads/2022/02/FARM.jpg)
FARM
![](https://www.zaptest.com/wp-content/uploads/2022/02/LOAD.jpg)