Full HTTPS POST with bearer token and assertions
25-https-post-bearer-full.yaml
HTTP(S)
What this example does
This example demonstrates full https post with bearer token and assertions.
Checks and behavior
- Sends an POST request to https://api.example.invalid/v1/check.
- Checks allowed/denied HTTP status codes.
- Validates required, forbidden or matching HTTP headers.
- Looks for expected response content and/or rejects known error markers.
- TLS settings cover certificate trust, certificate expiry.
Adapt example domains, addresses, credentials and thresholds to your environment before use.
YAML configuration
# Copyright (c) 2026 mati peterson. Maintainer: mati peterson <ipsonic@mailbox.org>. Project: https://ipsonic.com/probe/. Disclaimer: Provided AS IS, without warranty of any kind. Use at your own risk; validate checks and configurations before production use.
name: Full HTTPS POST with bearer token and assertions
url: https://api.example.invalid/v1/check
request:
method: POST
user_agent: httptest/1.0
headers:
Accept: application/json
json:
probe: integration
follow_redirects: false
auth:
type: bearer
token_env: HTTPTEST_API_TOKEN
timeouts:
connect: 3
response: 10
tls:
verify: true
min_valid_days: 14
tests:
status:
allow: [200, 201]
deny: [401, 403, 500, 503]
headers:
exists: [Content-Type]
absent: [X-Debug]
contains:
Content-Type: [application/json]
not_contains:
Server: [nginx/1.14]
body:
contains: ['"success"']
not_contains: [traceback, exception]