cURL

cURL parser

A cURL command is a request in disguise. The parser reads the options and shows you the HTTP request underneath: what is sent, where, and with which credentials.

command.shDetected: cURL ✓
curl 'https://api.example.com/search?q=widgets&page=2' \  -u admin:s3cret \  -H 'Accept: application/json' \  -b 'session=abc123'
Request view
GET  https://api.example.com/searchQuery parameters  q       widgets  page    2Headers  Accept  application/jsonAuthentication  Basic · adminCookies  session abc123
✓ Parsed locally · never executed

What the parser extracts

  • Method: from -X, or inferred (a body implies POST; -I implies HEAD)
  • URL and its query parameters
  • Headers from -H
  • Authentication: -u basic auth, bearer tokens, other Authorization schemes
  • Cookies from -b
  • Body from -d, --data-raw, --data-binary, --data-urlencode, --json and -F forms

Options it understands

Common flags like -L, -k, --compressed, -A, -e and -x are recognized. Output and logging flags such as -o, -s and -v do not change the request and are skipped without noise. Anything unrecognized is reported as a warning rather than silently dropped.

Bodies, typed

The body is classified as JSON, XML, form or multipart from the Content-Type or its content, and JSON and XML bodies are pretty-printed. If a JSON body is invalid, that is reported as an error against the request body, which is the kind of mistake that is hard to spot inside shell quoting. If a body is read from a file (@file), DocuFormat shows the file reference and never reads the file.

Security by design

Parsing is plain text processing. The command is not run, no network request is made, and referenced files are not read. See the cURL formatter for the readable rewrite, or explain a cURL command in plain language.

Questions, answered

Does it support multiple URLs in one command?

No. Only the first URL is used, and extras are reported as ignored.

Does it read files referenced with @?

No. It shows the file reference but never reads files.

Can I paste a command that starts with a $ prompt?

Yes. A leading shell prompt is recognized and removed.

Try the cURL formatter on your own input.

Paste it, format it, and fix it if it is broken, once DocuFormat opens.