Curl converter starts from a command you already have, which is the opposite of the builders. Paste curl 'https://example.test/api' -H 'Content-Type: application/json' --data-raw '{"name":"Sam"}' and set Output language to fetch. You get an await fetch() call with method POST, the content-type header, and the JSON text as the body. The same command can be rewritten as Axios, Python requests, Go, PHP or HTTPie.
The command is parsed, not executed. A file reference such as -d @notes is refused, because reading a local file would turn a converter into something that touches your disk. Shell substitutions, pipes and redirections are refused for the same reason: only literal arguments are accepted. Unsupported flags fail with the flag named.
One URL per command. If you pass a body and no Content-Type, the converter adds application/x-www-form-urlencoded, matching curl’s own default for -d. --data-raw does not get that treatment from a leading @, but a missing content type still follows the body rule when the body is literal data.
curl 'https://example.test/api' -H 'Content-Type: application/json' --data-raw '{"name":"Sam"}', output language fetch.
const response = await fetch("https://example.test/api", { method: "POST", headers: { "content-type": "application/json" }, body: "{\"name\":\"Sam\"}" }); console.log(await response.text());
Refusing @file and $variables keeps the page a translator. It will not quietly read a notes file or expand a secret from the shell.
No. The command is parsed into a URL, method, headers and body, then printed in another language. The host is not contacted.
The @ form tells curl to read a file. This page does not open files. Paste the literal body, or use --data-raw with the text.
No. One URL per snippet. A second URL is an error so a redirect target is not silently dropped.
Unsupported options fail by name. The builders cover method, headers and body. Flags such as --compressed or --retry are not rewritten.