HTTP Request Builder
Build cURL and browser-compatible Fetch snippets from request fields
Total input is limited to 1 MiB. This tool generates text without sending requests. Rebuild after edits; URL, headers and body are not saved as drafts.
Generated request snippets appear here.
cURL uses POSIX quoting. Fetch remains subject to CORS, browser-managed headers and credential policies; generated code does not prove server acceptance. Bodies without an explicit Content-Type use text/plain;charset=UTF-8 in both snippets. Copied output may contain credentials.
The full guide also includes pitfalls, worked examples, snippets, FAQs, and related tools for checking results or troubleshooting.
About this tool
HTTP Request Builder assembles a method, absolute HTTP(S) URL, ordered request headers, query pairs and a raw body into cURL and, when representable, browser Fetch code. Repeated query values are preserved and existing query spelling is retained when appending pairs. Raw body whitespace is retained. cURL output uses POSIX quoting and distinguishes an empty header from removing a header. Fetch output uses header pairs and explains browser restrictions: GET/HEAD bodies and forbidden headers cannot be copied faithfully, so the Fetch snippet is withheld. For bodies without Content-Type, both snippets explicitly use text/plain;charset=UTF-8. The tool generates text locally without sending requests or saving request drafts.
Suggested Workflow
Production Snippets
A GET body has different client limits
text
Method: GET
URL: https://api.example.com/search
Body: {"query":"sample"}
The cURL snippet retains GET and the literal body.
The browser Fetch snippet is withheld because Fetch prohibits a GET body.
Change the API method only if the server expects that different request.Frequently Asked Questions
Will both snippets always be available?
cURL is generated for supported input. Fetch is withheld when the browser cannot preserve the request, such as a GET/HEAD body or a forbidden header. The result lists the reason.
How are repeated headers represented?
cURL keeps separate header arguments. Fetch receives ordered header pairs, but browsers combine repeated names into comma-separated values. Confirm that this is appropriate for the particular header.
How should query parameters and empty headers be entered?
Use name=value query pairs and Name: Value headers, one per line. Repeated query names are retained. Name: with an empty value generates a cURL Name; argument to send an empty header.
What happens to the body and Content-Type?
Body whitespace is preserved. An empty body field means no body input. If a non-empty body has no Content-Type, both snippets add text/plain;charset=UTF-8; enter application/json explicitly for JSON.
Does this verify CORS or server acceptance?
No. It checks local input and browser expression limits, but does not call the URL, inspect the server or prove CORS, credentials or authentication will succeed.
Are request details stored?
No request drafts are saved; the previous draft key is removed on tool mount. Generated snippets and clipboard contents can still include credentials or other private request data.
Keep browsing