curl Command Builder
Fill in a method, URL, headers and a body, get back a properly quoted, ready-to-run curl command — the version of "let me just quickly test this API call" that doesn't involve remembering curl's flag syntax or getting bitten by unescaped quotes in a JSON body for the hundredth time.
Why the quoting actually matters here
Every value here is wrapped in single quotes specifically because single-quoted strings in POSIX shells (bash, zsh, sh) are the one quoting style where the shell doesn't try to interpret anything inside them — no variable expansion, no backtick command substitution, no backslash escape processing. That matters a lot for a JSON body, which is full of characters ({, ", $) that a shell would otherwise try to do something clever with. The one character single quotes can't contain is another single quote, which is why this tool handles that case specifically — closing the quote, inserting an escaped literal quote, and reopening it — rather than just hoping your data doesn't contain an apostrophe.
What gets built and why
- -X METHOD — only added for non-GET requests, since GET is curl's default and adding it explicitly is just noise
- -H — one per header line, each independently quoted
- -d — the request body, only included for methods that actually carry one (not GET or HEAD)
A couple of things worth knowing that this tool won't do for you
Setting Content-Type: application/json doesn't validate that your body is actually valid JSON — curl sends whatever bytes you give it, header or no header, and a malformed body with a correct Content-Type header will still fail, just on the server side instead of obviously. And -d defaults to a POST if you haven't specified a method at all — worth knowing if you're debugging why a request went out as POST when you expected something else. For file uploads specifically, you'd want -F (multipart form data) instead of -d, which is a different beast this tool doesn't attempt to build for you.