All languages

Shell

You're viewing a free preview. Sign in free to read every script.

Why this exists Nearly every tool has a REST API, and curl plus jq reaches all of them. The gap between a demo and a reliable script is small but specific: handling errors properly, not leaking the token, and walking…

Call a REST API with curl and jq: Auth, Errors and Pagination

A complete pattern for talking to a REST API from a script: keep the token out of the process list, separate the HTTP status from the body, fail clearly, paginate through results and shape JSON with jq. Shown with a GitHub example that lists stale pull requests.

Sign in free to read this script, along with the rest of the library.

Sign in free