shell-tokenised · flags reported

curl to fetch

Paste the command you already tested in the terminal and get a fetch call with the same method, headers and body.

0 characters

The command is parsed in this tab. Requests in curl commands routinely contain tokens and API keys, so nothing leaves the page.

Short answer: paste the command exactly as you ran it, pick fetch or raw HTTP. Anything the converter did not understand is named under the result rather than dropped.

What maps to what

What a converter cannot fix

A working terminal request is not automatically a working browser request. CORS, cookies and client certificates behave differently in a page. When the snippet fails with a blocked request, the server’s policy is the problem, not the conversion.

Comparing two versions of the same command? The text diff shows exactly what changed.

curl questions

Why not just rewrite the command with a few regular expressions?

Because quoting breaks them. A header value can contain a colon, a body can contain single quotes, and a line continuation splits a flag from its value. The command line is tokenised the way a shell tokenises it, so `-H "Authorization: Bearer a b"` stays one header instead of two.

What happens to flags the converter does not model?

They are listed under "Not modelled" and left out of the snippet. Silently dropping something like --data-binary @file would produce a snippet that posts an empty body, which is worse than telling you it needs attention.

Why does my snippet fail with a CORS error in the browser?

Because the browser enforces the server’s CORS policy for cross-origin requests, and a terminal does not. The snippet is correct; the server has to allow your origin. For a request the browser will not send, run it from a server or a Node script.

Are credentials in the command kept?

They are converted — -u becomes an Authorization header — and the page warns you, because the output now contains them. Nothing is uploaded, but the snippet is still a secret once you paste it somewhere.

Related tools