Dev TooloraLocal dev tools

> Web/API

HTTP Request Builder

Compose an HTTP request with query, headers, JSON, form or raw body and Bearer, API key or Basic auth, then export cURL, fetch, raw HTTP or Python code.

Runs locallyWorks offline
Auto-run
Back to results
Input

Source data

Export
Output

Result

Your result will appear here.

Tool guide

About this tool.

An HTTP request is a method, a URL, headers and an optional body. The builder assembles one from form fields: it adds query parameters, encodes the body as JSON, form data or raw text, and adds Bearer, API key or Basic authentication.

It writes the request as a cURL command, a JavaScript fetch call, a raw HTTP/1.1 message and Python requests code, ready for a terminal, a browser console or a script.

Nothing is sent: the tool only writes code.

  • Prepare a reproducible API call for a bug report, documentation or a teammate.
  • Switch a call between cURL, fetch and Python without retyping headers.
  • Check how a JSON or form body and authentication end up on the wire.

Enter the URL and choose the method. Add query parameters and headers, one per line.

Choose a body format and enter the body; JSON is validated and minified.

Choose an authentication method and fill in its fields. Password fields are not saved in drafts.

Choose an export, then copy or save the snippet. All shows a request summary and every format.

  • POST https://api.example.com/items with JSON {"name":"Ada"} → Content-Type: application/json is added.
  • Query lines page=2 and tag=local → https://api.example.com/items?page=2&tag=local.
  • Bearer token abc → Authorization: Bearer abc, unless you typed an Authorization header yourself.
  • API key in the query → ?X-API-Key=value is appended to the URL.
  • Basic auth ada and secret → Authorization: Basic YWRhOnNlY3JldA==.
  • Export Raw HTTP → POST /items HTTP/1.1 with Host and Content-Length headers.

  • No request is sent and nothing is uploaded. The snippets contain your credentials, so share them with care.
  • Headers you type take precedence over the generated Content-Type and Authorization headers.
  • cURL output uses single-quoted POSIX shell arguments and --globoff, so brackets and braces in a URL stay literal, and --head for HEAD; on Windows, run it in Git Bash or WSL, or adapt the quoting for PowerShell.
  • fetch drops headers that browsers control, such as Host, Connection and Content-Length, and browsers block cross-origin calls that the server does not allow with CORS.
  • GET and HEAD requests cannot carry a body in fetch.
  • Raw HTTP output uses HTTP/1.1 with CRLF line endings and a Content-Length counted in UTF-8 bytes.
  • Multipart forms and file uploads are not supported.

FAQ

Questions about HTTP Request Builder

Does the HTTP Request Builder send the request?

No. It only writes code: a cURL command, a fetch call, a raw HTTP/1.1 message and Python requests code. Copy a snippet into a terminal, browser console or script to actually call the API.

How is Basic auth encoded?

The username and password are joined with a colon and Base64-encoded, so ada and secret become Authorization: Basic YWRhOnNlY3JldA==. Base64 is reversible encoding, not encryption, so send it only over HTTPS.

Can I send a GET request with a JSON body?

The builder writes it, but the summary warns that fetch rejects a body on GET and HEAD. cURL and Python requests can send one, although many servers ignore it; use POST, PUT or PATCH for request bodies.

Should I put an API key in a header or the query string?

Prefer a header when the API allows it. Query strings end up in server logs, browser history and Referer headers, so choose API key location Query only when the API requires a parameter such as api_key.

Why is my JSON body minified?

Body format JSON parses the text and writes it back compactly, which removes whitespace, keeps only the last value of a duplicate key and stops on invalid JSON or on a number such as 1e400 or 1e-400. A number a double cannot hold, such as 12345678901234567890, keeps its exact digits. To send the text exactly as typed, choose Raw and set Raw content type to application/json.

Continue with

Raw HTTP Request InspectorParse a copied HTTP/1.x request, resolve its URL from Host or a base URL, and export cURL, fetch, raw HTTP or Python code.cURL ↔ Fetch ConverterConvert a cURL command into a JavaScript fetch call, or a fetch call back into a cURL command, keeping method, headers, body and redirects.HTTP Headers ParserParse raw HTTP request or response headers into structured JSON.Query String ParserConvert URL query strings to JSON and JSON objects back to query strings.Basic Auth GeneratorGenerate a UTF-8 HTTP Basic Authorization header from a username and password without sending a request.