HTTP Request Code Generator

Build an HTTP request or paste a cURL command and get ready-to-run code in 14 languages and clients.

Enter a request URL โ€” or paste a cURL command โ€” to see the code.

Generated code

 
No uploads. Your files stay on your device.

Free forever, no sign-up, no cookies. Buy me a coffee

How it works

Pick a method, type a URL, add headers one Name: value per line and paste a body if the request needs one. The snippet below is rebuilt on every keystroke for 14 clients: cURL, HTTPie, PowerShell, fetch, axios, node:https, Python requests, Go net/http, PHP cURL, Java HttpClient, C# HttpClient, Ruby net/http, Rust reqwest and Swift URLSession. Strings are escaped with the quoting rules of the target language, so a body full of quotes and backslashes still pastes in cleanly.

Paste an entire curl command into the URL box and it is taken apart for you. The importer understands -X, -H, -d and its --data-raw / --data-binary variants, --json, -u, -b, -A, -e, -G, -I, --url, single and double quoting, and backslash line continuations. Basic credentials from -u user:pass become an Authorization: Basic header encoded exactly as RFC 7617 describes: the UTF-8 bytes of user:pass in base64, so Aladdin:open sesame becomes QWxhZGRpbjpvcGVuIHNlc2FtZQ==. Method defaults follow curl itself โ€” GET, or POST as soon as a body is present.

This is a best-effort translator, not a full shell parser or a curl reimplementation. Multipart uploads (-F), --data-urlencode, file references such as -d @payload.json, proxies and TLS client certificates are flagged in a note under the form rather than silently guessed at, so you always know which part of the snippet still needs a human. Header and method semantics follow RFC 9110, and everything runs in your browser: URLs, tokens and payloads are never sent anywhere.

Frequently asked questions

How do I convert a cURL command to code?

Paste the whole curl command into the request URL box. It is taken apart into method, URL, headers and body, and the snippet is rebuilt straight away. Then pick your target from the language list: cURL, HTTPie, PowerShell, fetch, axios, node:https, Python requests, Go net/http, PHP cURL, Java HttpClient, C# HttpClient, Ruby net/http, Rust reqwest or Swift URLSession.

Is it safe to paste a request that contains an API token?

Yes. The page never sends a request and never uploads anything: parsing and code generation run in JavaScript on your own device, so the URL, the Authorization header and the payload stay in the browser tab. That said, treat any snippet you copy as secret, because the token is written into it in plain text.

Which cURL options are supported, and what is left out?

The importer handles -X, -H, -d and its --data-raw, --data-binary and --data-ascii variants, --json, -u (encoded as RFC 7617 Basic auth), -b, -A, -e, -G, -I, --url, single and double quoting and backslash line continuations. It is a best-effort translator, not a shell or a curl reimplementation: multipart -F uploads, --data-urlencode, file bodies like -d @payload.json, proxies and client certificates are listed in a note under the form so you know what still needs a human.

Report a bug