cURLParse cURL Converter

Example: Basic Auth with a Pagination Cursor

cURLParse — Convert cURL Commands to Python, Node.js, Go & Rust Guides · Updated 2026-10-01 · All guides
curl -sS 'https://api.example.com/v2/orders?limit=50&cursor=eyJwYWdlIjoyfQ' \
  -u 'user:password' -i -w '\n%{http_code}\n'
  • -u base64-encodes user:password into Authorization: Basic .... Converted code must set the header manually in some languages; the converter does this explicitly rather than relying on an auth kwarg that differs per library.
  • The -w footer makes CI assertions easy: test $(curl ...) -eq 200 is brittle; a printed code isn't. The flags guide covers -w and --fail-with-body, the two flags that make scripts honest.
  • -i on a paginated endpoint surfaces Link: rel="next" — the actual pagination cursor, which the body usually doesn't duplicate.

FAQ

Is Basic auth safe over HTTPS? Yes, that's what it was designed for — base64 is encoding, not encryption, so the TLS layer is the protection. Never over plain HTTP.

The cursor in my URL changed to something random. Bug? No — many APIs return opaque cursors (base64 of an offset or keyset). Treat them as opaque; don't construct them client-side. Parse Link: rel="next" instead.

Why does the converter print the Authorization header instead of using auth=(user, pass)? Because kwargs differ across requests/httpx/fetch and silently change behavior. An explicit header converts identically everywhere.

Developer Sponsor / Partner
Copied to clipboard!