> For the complete documentation index, see [llms.txt](https://olddocs.exivity.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://olddocs.exivity.io/3.5.4/data-pipelines/extract/subroutines/validate_response.md).

# validate\_response

This subroutine allows validating an HTTP response from a [buffer](/3.5.4/data-pipelines/extract/language/buffer.md).

### Syntax

```
gosub validate_response({my_buffer})
```

### Code snippet

```
subroutine validate_response {
    if (${HTTP_STATUS_CODE} != 200) {
        print Got HTTP status ${HTTP_STATUS_CODE}, expected a status of 200
        print The server response was:
        json format ${SUBARG_1}
        print ${SUBARG_1}
        terminate with error
    }
}


```

###
