API Request Builder

Build, inspect and export HTTP requests — methods, headers, query parameters, bodies and auth — as ready-to-run cURL commands.

Pick a method, enter the endpoint, add query parameters, headers and a request body, and this tool assembles the full request for you. It watches the whole thing live — flagging invalid JSON, duplicate or empty fields and missing Content-Type headers — and exports the result as a cURL command, the raw HTTP wire format, or a JavaScript fetch() snippet. Bearer, Basic and API-key auth are handled for you.

🔒 100% private — nothing is uploaded or stored. The request is assembled entirely in your browser with plain JavaScript. Your URL, headers, API keys and tokens never leave your device — we don’t see, log or store them, and no network request is made from this page at all. The only way anything gets out is when you copy the generated cURL / HTTP / fetch code yourself.

Request

Enter a URL to see it broken down.
Load a sample:

Authentication

Query parameters

Any query string you type into the URL above is imported here automatically. Values are percent-encoded in the output; untick a row to exclude it.

UseKeyValue

Headers

Quick add:
UseHeaderValue

Body

None JSON Form data Raw text

cURL options

Generated request

cURL Raw HTTP JavaScript fetch

        
        
        

Report

Nothing to report yet.

Reading the generated cURL

Every value is wrapped in single quotes, which tell the shell to treat the contents literally — spaces, &, # and $ all pass through untouched. The one character that can’t appear inside single quotes is the single quote itself; cURL convention escapes it as '\'' (close the quote, add an escaped quote, reopen). That’s why a body containing O’Brien looks like --data-raw '{...O'\''Brien...}' — it’s correct, and pasting it into a terminal works as-is.

The body flag matters. --data-raw sends the body exactly as written. Plain --data would interpret a leading @ as “read the body from this file”, which is a classic footgun when your JSON starts with "@type". Form data uses --data-urlencode per field instead, because cURL then percent-encodes each value for you — spaces become %20, & becomes %26 — which is exactly what application/x-www-form-urlencoded requires.

Finally, the method flag: curl defaults to GET, so a JSON POST doesn’t need -X POST (the --data flag implies it), but DELETE always does — without -X DELETE curl would silently send a GET. Tick “Always add an explicit -X flag” if you prefer the method spelled out everywhere.

HTTP methods at a glance

Two properties from RFC 9110 are worth knowing when you pick a method. Safe means the request is intended only to retrieve data and must not change server state. Idempotent means repeating the same request any number of times has the same effect as doing it once — so retrying a failed idempotent request is safe, while retrying a non-idempotent one (like a payment POST) can double-charge.

MethodSafeIdempotentTypical use
GETyesyesRead a resource; never carries a body
POSTnonoCreate a resource or submit data for processing
PUTnoyesReplace a resource entirely at a known URI
PATCHnonoApply a partial update to a resource
DELETEnoyes*Remove a resource (*idempotent in practice)
HEADyesyesSame as GET but returns headers only
OPTIONSyesyesDiscover what methods and features a server supports

Query string vs request body

Query parameters travel in the URL, which means they show up in server access logs, proxy logs, browser history and analytics — so never put secrets or tokens in them (this tool defaults API-key auth to a header for exactly that reason). They’re also subject to practical length limits: most servers and intermediaries cap URLs around 2 KB, while request bodies can be many megabytes.

The split in practice: GET/DELETE take their inputs as query parameters (filters, pagination, the resource id); POST/PUT/PATCH carry their payload in the body with a matching Content-Type. If an API asks for the same thing both ways, prefer the body — it’s private, cacheable-safe and has no length ceiling.

Content-Type quick reference

Content-TypeBody shapeNotes
application/json{"key": "value"}The default for modern REST APIs; this tool validates the JSON live
application/x-www-form-urlencodeda=1&b=twoWhat HTML form submits use; values must be percent-encoded
multipart/form-dataparts with boundariesRequired for file uploads — build those with cURL -F, not this tool
application/xml<root><item/></root>Still common in SOAP and some government/finance APIs
text/plainany textWebhooks, raw CSV drops, simple key/value endpoints

Need the other direction? Paste any exported cURL command into the cURL to Code Converter to turn it into Python, JavaScript, Go and six more languages.


Luke Keam
Thank you for reading. Get in touch
Luke Keam | techgeek.biz