Search…
validate_response
This subroutine allows validating an HTTP response from a buffer.

Syntax

1
gosub validate_response({my_buffer})
Copied!

Code snippet

1
subroutine validate_response {
2
if (${HTTP_STATUS_CODE} != 200) {
3
print Got HTTP status ${HTTP_STATUS_CODE}, expected a status of 200
4
print The server response was:
5
json format ${SUBARG_1}
6
print ${SUBARG_1}
7
terminate with error
8
}
9
}
10
11
Copied!

Last modified 5mo ago
Export as PDF
Copy link