cURL Command Generator
Most curl examples break the moment a header value contains a space, because the quoting was written by hand and never tested. This generates a complete request — method, URL, headers, JSON body — and then splits the finished command back into words the way a shell does, checking that every header, the URL and the body come out as single arguments. That is the failure worth catching: a command that looks right and sends half a header.
What this generator does
Builds a request as data — method, URL, headers, body — renders it as a shell command with each argument quoted only where it needs to be, then splits that command back into words using the shell's own quoting rules and compares what comes out with what went in.
How to use this tool
- Generate a request.
- Read the method, headers and body.
- Check the verification note under the command.
- Copy it, and replace the placeholder token with your own.
Understanding the controls
- Generate
- Draws a fresh method, host, path, header set and body. Bodies appear only on the methods that take one.
Common use cases
- Starting from a working request rather than the manual page
- Showing someone what a request to your API should look like
- Testing that your own tooling parses a curl command correctly
- Seeing how a header value with spaces has to be quoted
- Producing a request for documentation without pasting a real token
How this generator works
The splitter is written against the shell's quoting rules rather than against the writer, which is the point of having it: a checker that re-joined the writer's own fields would agree with any mistake the writer made. It handles single and double quotes, backslash escapes and the awkward case where an apostrophe has to be closed, escaped and reopened. Any header value containing a space or a comma is generated deliberately, because that is what breaks hand-written examples.
Randomness and fairness
Method, host, path, headers and body values are drawn with your browser's cryptographic random source. There is no seed.
For how randomness is produced across the whole site, see how Generate Random works.
Limitations and good to know
- One request at a time, with no cookies, no form uploads, no client certificates and no proxy options.
- The token is a placeholder that cannot authenticate anywhere, and the hosts are example domains that do not resolve.
- Quoting follows POSIX shell rules; a Windows command prompt quotes differently and the command will need adjusting.
- The check confirms the command survives a shell, not that the API it names would accept the request.
Privacy and your data
The command is built in your browser from built-in sample values. You enter nothing, nothing is uploaded or stored, and analytics records only that the tool ran.
Related generators
- htaccess Redirect GeneratorSample RewriteRule redirects, each applied to an example path to show where it actually lands.
- Mock API Response GeneratorA sample successful JSON API response, distinct from the site's error-shaped mock response tool.
- Docker Compose File GeneratorA sample docker-compose.yml with an app service, a data store, a volume and a network — parsed back and checked before you see it.
- API Key GeneratorA sample API key for testing config, mocks or documentation examples.