Skip to content

CICD-324 · HTTP endpoint verification ​

Encyclopedia · Advanced networking and API testing · All snippets

Previous · CICD-323 · Next · CICD-325

1. Where it fits ​

  • Placement CI run step or authorized lab terminal.
  • Prerequisites authorized test service, known endpoint or local fixture and the named test CLI.
  • Platforms local-linux, github-actions, gitea-actions.
  • Parameters HEALTH_URL.

2. Copy the snippet ​

bash
curl --fail-with-body --silent --show-error --connect-timeout 3 --max-time 8 "${HEALTH_URL:?}" | jq -e '.status == "ok"'

3. How it works ​

The request checks the selected HTTP interface. Timeouts limit waiting, and an explicit exit or payload condition determines pass and fail. The expression filters or transforms the input JSON. Where jq -e is used, a false or empty result can fail the gate.

4. Verify the result ​

Verify health payload as well as HTTP status. Do not store tokens in URLs.

Validation syntax-validated (Bash parse). Status definitions.