...
response.code is the status code of the response (e.g. 200, 404 etc).
Example
Assuming the server returns “The response body from the server” as response body:
Input:
| Code Block |
|---|
{% http_request target: 'https://www.apiserver.com/api/v1/api_endpoint', method: 'get', advanced: true %}
{{ response.body }}
{{ response.code }}
{% endhttp_request %} |
Output:
| Code Block |
|---|
"The response body from the server"
200 |