About curl to Code

curl to Code parses a curl command and renders the same request as a JavaScript fetch() call, an HTTPie command, or a PowerShell Invoke-RestMethod call. It understands the method, headers, request body, basic auth, and the -G flag.

Parsing and rendering happen in the page. Nothing is uploaded.

How to use it

  1. Paste a curl command, with or without backslash line breaks.
  2. Pick the output: fetch(), HTTPie, or PowerShell.
  3. Copy the result.

Common questions

Which curl flags are read?

-X/--request, -H/--header, -d and its variants, -G, -u (as a Basic auth header), -A, -e, -b, and the --flag=value form. Options like -L, -s, -k are ignored.

What method is assumed?

GET, or POST when a request body is present and no method was given.

Is multipart form data supported?

-F is noted with a warning but not fully translated.

Is anything uploaded?

No. It all runs in your browser.