HTTP Request Builder

Build an HTTP request — method, URL, query, headers, auth and body — and copy it as cURL, fetch, axios, Python, HTTPie or a .http file. Nothing is sent.

HTTP Request Builder

Nothing open
On this device
  • ErrorEnter a URL.

Query parameters

No parameters.

Build an HTTP request

Enter a method and URL, or import a cURL command, to get the request as cURL, fetch, axios, Python, HTTPie or a .http file. Nothing is sent from this page: copy the code and run it where you work.

Auth: bearer, basic, API key · Body: JSON, form, multipart, text

Writes code only — nothing is sent from this page. Saved and recent requests stay on this device, without credentials
How is this calculated?
The cURL command uses --data-raw so the body is sent exactly as written (plain -d would read a leading @ as a file name), --form-string for text parts of a multipart body for the same reason, and --head rather than -X HEAD, which would leave curl waiting for a body. Values are quoted for a POSIX shell. HTTPie gets --raw for bodies, and its separator characters are escaped in names and values. Form bodies are encoded as browsers encode forms. The cURL and HTTPie output was tested by running it against a local server and comparing what arrived — method, URL, every header, the credentials and the body, byte for byte — and every cURL command reads back into the same request.

Runs in your browser — nothing you enter leaves this device.

About this tool

What it does

Builds an HTTP request the way you think about it — a method, a URL, query parameters, headers, credentials and a body — and writes it out as a command or code you can run: cURL, JavaScript fetch, axios, Python requests, HTTPie, or a .http file for the JetBrains HTTP Client and VS Code’s REST Client. It checks the request as you type: a URL that is not complete, a header name with a space in it, a header value with a line break, JSON that does not parse, a GET with a body, credentials over plain http://, an API key in the query string. Nothing is sent from this page — you copy the request and run it from your terminal, your code or your editor, where it reaches the API directly.

How to use it
  1. Choose the method and type the URL. Query parameters already in the URL appear on the Query tab, decoded; edit them there and the URL is rewritten with each value percent-encoded.
  2. Add headers on the Headers tab. Untick one to leave it out without deleting it.
  3. On Auth, pick a bearer token, Basic user name and password, or an API key sent in a header or the query.
  4. On Body, pick JSON (Format tidies it), a form, multipart with text and file fields, or text with its own Content-Type. The matching Content-Type header is added unless you set one.
  5. Choose what to write it as, then copy it or download it. Already have a curl command, from the browser’s Network tab for example? Import it and edit it here.
  6. Open Saved to keep a request under a name, or to reopen one you built earlier from Recent.
Limits and your data
  • Nothing is sent: a page on this site cannot call other servers (its Content Security Policy forbids it, and most APIs would refuse a browser anyway). Run the request yourself.
  • The cURL command is for bash, zsh and other POSIX shells, including Git Bash on Windows; Windows cmd and PowerShell quote differently.
  • Multipart files are written as paths, to be read where the command runs. The page does not read your files.
  • HTTPie cannot write a backslash immediately before : = @ or ; in a header or field; the tool says when that happens.
  • Saved requests are a flat list of up to 50, on this device; there are no shared collections or environments, and credentials always have to be typed in again.
  • Nothing is sent or uploaded, and the page works offline. Saved and recent requests are kept in this browser only (they are in Export my data and gone with Delete everything), and never with their credentials: the auth token, password or key, a password written into the URL, secret-looking headers such as Authorization, Cookie or any API-key header, query and body fields named like token, key, secret or password, and any JWT are replaced with “<removed when saved>” before anything is stored. Recent requests follow the “Keep recent inputs” setting. Remember that the command you copy does contain the credentials — take care where you paste it.

Questions

Why does it not send the request?

Sending from a web page needs the API to allow cross-origin requests, which most do not, and it would mean this site’s page talking to any server you name. Sending through our server instead would mean your tokens passing through it. Building the request here and running it yourself avoids both: the credentials go from your machine straight to the API.

Why does it warn about a GET request with a body?

HTTP does not give a GET body any meaning. fetch in a browser refuses to send one, and some servers, proxies and caches drop it. If the API really reads it, curl will still send it; otherwise move the data into the query or use POST.

Why is an API key in the query string a problem?

URLs are written to server access logs, proxy logs and browser history, so a key in the query is copied into all of them. A header such as X-API-Key or Authorization is not logged by default. Use the query only when the API offers nothing else.

What is a .http file?

A plain-text request format read by the HTTP Client in JetBrains IDEs and the REST Client extension for VS Code: the method and URL on the first line, headers below, a blank line, then the body. Save it in your project and run it from the editor.

How is this different from the cURL Converter?

The cURL Converter turns a curl command you already have into code. This tool builds a request from a form — and can import a curl command to start from.