HTTP Request Builder
Build HTTP requests and export as curl, fetch, or axios code.
Query Params0 active
Headers0 active
When an HTTP request builder is the right tool
Use this page when you want a curl command, a fetch call, or an axios call written for you from a method, URL, query string, headers, and an optional body. The snippet updates as you type. This tool does not send the request — it only builds the text for you to copy.
If you need to see the headers a live URL returns, that is a different job: HTTP Header Inspector contacts the target (or a proxy) and can still miss headers. This builder never leaves your browser.
Use cases
Drafting a curl command for documentation
The default method is GET and the default URL is https://api.example.com/users. Leave the output format on curl, add query params or headers as needed, and Copy. Load Sample Headers fills in a placeholder Bearer token and an Accept header — replace the placeholder before you run anything.
Getting a fetch or axios starter
Switch the output format to fetch or axios. For POST, PUT, or PATCH, open Body and paste the payload. A json body adds Content-Type: application/json automatically. fetch always appends .then(res => res.json()), which is fine for a JSON API and misleading for a plain-text or error response. axios treats a json body as raw JavaScript, so the text in the box must parse as a JS object literal (JSON usually does).
Adding query parameters to a URL that already has some
Enabled params are encoded and appended. If the base URL already contains ?, they are joined with &. A disabled row, or a row whose key is blank, is skipped. You can add as many rows as you need.
How the snippets are built
The full URL is the base plus the active query string. curl starts with curl -X METHOD 'url', then one -H per active header, then — for POST, PUT, or PATCH when the body is non-empty — an automatic JSON content-type if you picked json, and a -d body. Apostrophes in the body are escaped for single-quoted shell strings; apostrophes in the URL or header values are not. fetch and axios follow the same inclusion rules for headers and bodies, with the format differences noted above. The body section is hidden for GET, DELETE, HEAD, and OPTIONS, and a body left over from a previous POST is ignored while those methods are selected.
curl -X POST 'https://api.example.com/users' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"name": "Ada"
}'That is the kind of snippet you get after choosing POST, adding an Authorization header, setting body type to json, and typing a small object. The same form can be switched to fetch or axios without re-entering the fields.
What this tool does not do
It does not execute the request, follow redirects, attach cookies, build multipart forms, or encode a form body for you. The form body type is a label, not a urlencoded encoder, and it does not add a form Content-Type. For DNS on the host in the URL, use DNS Lookup. To take a URL apart first, use URL Parser.
How to use HTTP Request Builder
- Choose a method and enter the URL. Query Params are open by default; add keys and values there.
- Expand Headers if you need them. Load Sample Headers is a shortcut for a Bearer token and Accept.
- For POST, PUT, or PATCH, expand Body, pick json, text, or form, and paste the payload.
- Select curl, fetch, or axios, then Copy the generated snippet.
Frequently asked questions
Does this tool send the request?
No. It only generates curl, fetch, or axios snippets from the form. Nothing is sent to the URL you type. The snippet updates as you edit. Copy it and run it yourself in a terminal or in your own code if you want the request to actually fire.
Which HTTP methods and body types are supported?
The method list is GET, POST, PUT, PATCH, DELETE, HEAD, and OPTIONS. The body editor appears only for POST, PUT, and PATCH. Body type can be json, text, or form, but those labels mainly change how the snippet is built: only json automatically adds a Content-Type: application/json header. The form option does not set application/x-www-form-urlencoded or encode fields for you.
How do the curl, fetch, and axios snippets differ?
curl uses single quotes around the URL, headers, and body, with a backslash before any apostrophe in the body, and backslash-newline continuations. fetch always chains res.json() and then console.log, even for GET or non-JSON responses, and it passes the body as a JavaScript string literal. axios inserts a json body as raw JavaScript (so the text must be valid JS), and stringifies text or form bodies. GET, DELETE, HEAD, and OPTIONS never include a body in any of the three formats.
How are query parameters and headers included?
A param or header is used only when it is enabled and its key is not blank after trim. Query keys and values are encodeURIComponent’d and appended with ? or, if the base URL already contains a question mark, with &. Disabled rows and blank keys are skipped. Load Sample Headers replaces the header list with Authorization: Bearer YOUR_TOKEN, Accept: application/json, and an empty row — it does not change the URL, params, or body.
Can I use this to inspect live response headers?
No. This page never contacts the server. If you want to see headers a URL actually returns, use the HTTP Header Inspector, which tries a CORS HEAD request and may fall back to a third-party proxy. That list can still be incomplete.
Is my request configuration uploaded?
No. Snippet generation runs in your browser. Be careful anyway: if you paste a real Authorization token into the form, it will appear in the generated snippet and in whatever you copy or share. Closing the tab discards the form.
Related tools and guides
References
- curl, the Fetch API, and axios are the three snippet targets. This page writes code for those clients; it does not run them.
- Method names follow the usual HTTP set (GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS). The builder does not add TRACE or CONNECT, and it does not implement cookies, multipart uploads, or authentication flows beyond whatever header you type.