All binaries

curl

ghcr.io/openotters/tools/curl:latest

curl — the canonical HTTP client. Statically-linked builds from stunnel/static-curl, no system openssl/libcurl needed. Same flag surface as system curl(1).

Usage

curl — the HTTP client. Pass standard curl(1) flags as args. Common shapes the agent uses:

GET with auth header

{
  "args": [
    "-sS",
    "-H", "Authorization: Bearer $HASS_TOKEN",
    "$HASS_URL/api/states"
  ]
}

POST JSON body

{
  "args": [
    "-sS", "-X", "POST",
    "-H", "Authorization: Bearer $HASS_TOKEN",
    "-H", "Content-Type: application/json",
    "-d", "{\"entity_id\":\"light.kitchen\"}",
    "$HASS_URL/api/services/light/turn_on"
  ]
}

Useful flags

-s, --silent        no progress meter
-S, --show-error    show errors even when --silent (combine -sS)
-i, --include       prepend response headers to output
-L, --location      follow redirects
-f, --fail          exit non-zero on >=400 responses (no body)
-k, --insecure      skip TLS verification (self-signed hosts)
--connect-timeout S TCP/TLS handshake timeout
--max-time S        total request timeout
-X METHOD           HTTP method (default GET, POST when -d set)
-H "name: value"    request header (repeatable)
-d <data>           request body (string)
--data-binary @file body from file
-o <file>           write body to file (default: stdout)

Pair with sh + jq

sh -c 'curl -sS -H "Authorization: Bearer $HASS_TOKEN" "$HASS_URL/api/states" | jq ".[].entity_id"'

Tags

4 tags
  • v8.20.0
  • v8.20
  • v8
  • latest