A laptop, a phone and a hand writing in a notebook on a wooden desk, banner image on the HTTP Request Builder page

Werkzeuge / Build suite

HTTP Request Builder

Build an HTTP request, check it for mistakes, and copy it as curl, fetch, Python requests or Node code.

Pick a method, enter the URL, add query parameters, headers, auth and a body. The tool flags problems, then writes the same request in four languages. Sending is a separate button, off by default, and it tells you what leaves your browser.

Open the toolWhat is insideWhat it cannot do
Screenshot of the HTTP Request Builder tool

What is inside

What is inside the tool.

Seven methods

GET, POST, PUT, PATCH, DELETE, HEAD and OPTIONS. A body on GET or HEAD is left out of the code, and the tool says so.

URL and query parameters

Enter one key=value per line. Names and values are percent-encoded and added to any query already in the URL. A fragment is kept. A line with no = is flagged.

Header checks

A line with no colon, a name with illegal characters, control characters in a value and repeated names are flagged. Headers a browser will not let a page set, such as Host, are listed in the code and called out for Send.

Bearer and Basic auth

Basic uses UTF-8 before base64, so a name or password with accents works. A colon in the username is refused because it cannot be encoded.

JSON, form and raw bodies

JSON is parsed and flagged if invalid. Form lines are encoded as application/x-www-form-urlencoded. Raw is sent as typed. Content-Type is added when you did not set one, and the tool tells you.

Four code tabs

curl, fetch, Python requests and Node. Each one has Copy and Download. Quotes, apostrophes, newlines, dollar signs and Unicode are escaped for that language.

Send, with a disclosure

Send makes one request from your browser. It states that the request leaves your device, shows the status and body, and explains a blocked request. A request with problems is not sent.

How to use it

Four steps.

Step 1

Choose the method and paste the URL.

Step 2

Add query parameters, headers, auth and a body. Read the checks under the form.

Step 3

Pick a language tab and press Copy or Download.

Step 4

Press Send only if you want the browser to make the request now.

What it cannot do

Limits.

Send is limited by the browser

A page can only read a response when the server allows it with CORS. When Send fails the tool says the outcome is unknown. A simple request can reach the server even though the page cannot read the answer. If the browser had to ask permission first and was refused, the real request was not sent. The page cannot tell which, so check the server log or use the curl tab.

Forbidden headers are not sent

Browsers ignore headers such as Host. They stay in the generated code so curl and Python can use them.

Repeated headers differ by tool

curl sends each repeated header as its own line. fetch, Node, Python requests and Send join them into one header with a comma and a space, and the code says so. Some servers treat the two forms differently. The tool flags every repeat.

Not a full client

No OAuth flows, cookie jar, file upload, multipart bodies, environments or saved collections.

Credentials are in the code

Bearer tokens and Basic passwords appear in plain text in the snippets. Do not paste real secrets into a shared screen or ticket.

Other clients not run

Only curl, Python requests and Node fetch were run. The tool does not generate code for other languages.

What it does

Features and functions.

Runs inA browser tab
Body typesNone, JSON, form, raw
AuthBearer, Basic
Code snippetscurl, fetch, Python requests, Node
Import a curl commandPaste a curl command and every field fills in
Request checks before sendingYes, listed above

Common mistakes

Each of these produces a check.

JSON with a trailing comma

The body is flagged as invalid JSON and no code is produced until it is fixed.

Sending a body with GET

Most servers ignore it. The body is left out and the tool says so.

Basic auth with a colon in the username

The format cannot carry it, so the tool refuses.

A key pasted into the URL

Query values are encoded, but the key still sits in the URL and in logs. Prefer a header when the API allows it.

Forgetting Content-Type

The tool adds it for JSON and form bodies and says it did.

Raw body, no Content-Type

Nothing is added, because the tool cannot know the type.

Questions

Before you ask.

Is anything sent while I build?

No. Only the Send button makes a request.

Why did Send fail but curl works?

The server probably does not allow cross-origin reads. The request may or may not have reached it. Run the curl snippet.

Why is Host not sent?

Browsers do not allow a page to set it.

Are my credentials stored?

No. They stay in the page and in the code you copy.

What does it cost?

Nothing. No account.

Your data

What stays on your device.

Building and generating code run in this browser tab. Nothing is sent until you press Send, and then the request goes from your browser straight to the URL you entered. Your credentials appear in the generated code, so treat it like a secret.

Keep going

Other tools you may want next.

Sources

Where the facts come from.

Try it

Build the request, then copy the code

Open HTTP Request Builder
A laptop, headphones, a camera, a phone and a plant on a white desk, seen from above, banner image on the HTTP Request Builder page

Try it now.

HTTP Request Builder runs in your browser. No account needed.

Input To Output

Request in, code and checks out

Method and URLQuery,headers, authand bodyOr a pastedcurl commandChecks as youtypeCode in fourstylesOptional liveresponseHTTP RequestBuilderInOut
InMethod and URLQuery, headers, auth and bodyOr a pasted curl commandHTTP RequestBuilderChecks as you typeCode in four stylesOptional live responseOut
Everything is built in the tab until you press Send.

Pipeline

How the request is built

Read the URL andkeep its own queryAdd your querylines,percent-encodedRead each headerlineAdd theAuthorizationheader from AuthCheck the body forits typeAdd Content-Typeif none was givenWrite the code
Read the URL and keep its ownqueryAdd your query lines,percent-encodedRead each header lineAdd the Authorization header fromAuthCheck the body for its typeAdd Content-Type if none was givenWrite the code
In this order.

Before After

Query encoding

You typeIn the URLq=hello worldtag=a&bname=Zoënote=it'spath=a/bq=hello%20worldtag=a%26bname=Zo%C3%ABnote=it%27spath=a%2Fb
You type to In the URLq=hello worldq=hello%20worldtag=a&btag=a%26bname=Zoëname=Zo%C3%ABnote=it'snote=it%27spath=a/bpath=a%2Fb
Each value is percent-encoded.

Before After

URL building

EnteredFinal URLhttps://api.example.com/items?draft=1plus page=2 and q=hello worldhttps://x.test/a#top plusk=vhttps://x.test/a?z=1 plusnothinghttps://api.example.com/items?draft=1&page=2&q=hello%20worldhttps://x.test/a?k=v#tophttps://x.test/a?z=1
Entered to Final URLhttps://api.example.com/items?draft=1plus page=2 and q=hello worldhttps://api.example.com/items?draft=1&page=2&q=hello%20worldhttps://x.test/a#top plus k=vhttps://x.test/a?k=v#tophttps://x.test/a?z=1 plus nothinghttps://x.test/a?z=1
Your query lines join the URL.

Support Matrix

What each code style does

MethodHeadersBodyRepeatedheaders keptapartRepeatedheadersjoinedComment onrepeatscurlfetchPythonNode
curlMethodHeadersBodyRepeated headers kept apartfetchMethodHeadersBodyRepeated headers joinedComment on repeatsPythonMethodHeadersBodyRepeated headers joinedComment on repeatsNodeMethodHeadersBodyRepeated headers joinedComment on repeats
The four tabs differ on a few points.

Bar Compare

Lines of code for the sample request

curl8 linesfetch12 linesPython5 linesNode12 lines
curl8 linesfetch12 linesPython5 linesNode12 lines
The sample is a POST with four headers and a JSON body.

Before After

Repeated headers

WhereWhat happenscurlfetchPythonSend buttonSent as separate -H linesPassed as pairs; fetch joinsthem with ", "Joined with ", " and acomment says soJoined with ", "
Where to What happenscurlSent as separate -H linesfetchPassed as pairs; fetch joins themwith ", "PythonJoined with ", " and a comment sayssoSend buttonJoined with ", "
Two Accept lines, handled four ways.

Real Timeline

Header order in the sample code

Accept1 headerX-Request-Id2 headerAuthorization3 headerContent-Type4 header
1Accept1 header2X-Request-Id2 header3Authorization3 header4Content-Type4 header
The code lists headers in this order.

Before After

Auth becomes a header

Auth sectionHeader addedBearer token: abcBasic: ada and pwAuthorization: Bearer abcAuthorization: BasicYWRhOnB3
Auth section to Header addedBearer token: abcAuthorization: Bearer abcBasic: ada and pwAuthorization: Basic YWRhOnB3
Bearer and Basic.

Before After

Body types

BodyResultJSON: {"a":1}Form lines: name=AdaLovelace and age=36Raw text: helloContent-Type:application/json addedname=Ada%20Lovelace&age=36,Content-Type urlencodedaddedSent as typed, noContent-Type added
Body to ResultJSON: {"a":1}Content-Type: application/json addedForm lines: name=Ada Lovelace andage=36name=Ada%20Lovelace&age=36,Content-Type urlencoded addedRaw text: helloSent as typed, no Content-Type added
What each type adds.

Before After

Method in curl

Methodcurl codeGETHEADPOSTcurl with the URL onlycurl -Icurl -X POST
Method to curl codeGETcurl with the URL onlyHEADcurl -IPOSTcurl -X POST
How the method shows.

Before After

Problems that block the code

You didMessageURL left blankftp://x.testexample.comHeader line: AcceptBearer selected, token blankEnter a URL.Only http and https URLs aresupported.The URL is not valid. Includehttps:// at the start.Header line 1 has no 'Name:value' form.Enter the bearer token.
You did to MessageURL left blankEnter a URL.ftp://x.testOnly http and https URLs aresupported.example.comThe URL is not valid. Includehttps:// at the start.Header line: AcceptHeader line 1 has no 'Name: value'form.Bearer selected, token blankEnter the bearer token.
Fix these and the code appears.

Before After

Warnings that do not block

You didMessageGET with a bodyPOST with no bodyHeader: Cookie: a=1Authorization header typedand Auth also setGET requests with a body areunusual. The body is leftout of the code.POST without a body. That isallowed, and some serversexpect one.Browsers do not let a page setCookie. The code includes it;the Send button will not.An Authorization header isalready in the list; the Authsection adds a second one.
You did to MessageGET with a bodyGET requests with a body are unusual.The body is left out of the code.POST with no bodyPOST without a body. That is allowed,and some servers expect one.Header: Cookie: a=1Browsers do not let a page set Cookie. Thecode includes it; the Send button will not.Authorization header typed and Authalso setAn Authorization header is already in thelist; the Auth section adds a second one.
The code still builds.

Before After

Header line check

LineResultAccept: application/jsonAcceptBad Name: vAcceptedError: line 1 has no 'Name:value' form.Error: the name hascharacters that are notallowed in a header name.
Line to ResultAccept: application/jsonAcceptedAcceptError: line 1 has no 'Name: value'form.Bad Name: vError: the name has characters thatare not allowed in a header name.
Name: value, with a legal name.

Support Matrix

What each section can do

Can block thecodeCan warnAdds a headerIspercent-encodedMethodURLQuery linesHeadersAuthBody
MethodCan warnURLCan block the codeCan warnQuery linesCan warnIs percent-encodedHeadersCan block the codeCan warnAuthCan block the codeCan warnAdds a headerBodyCan block the codeCan warnAdds a headerIs percent-encoded
Errors, warnings, added headers, encoding.

Pipeline

What Send does

Fix any problemsfirst; nothing issent until you doDrop headers thebrowser refusesCall fetch withyour method,headers and bodyShow status, timein ms and lengthof the replyShow the exposedheaders and thefirst 20,000characters
Fix any problems first; nothing issent until you doDrop headers the browser refusesCall fetch with your method,headers and bodyShow status, time in ms and lengthof the replyShow the exposed headers and thefirst 20,000 characters
A real request from your tab.

Before After

Curl import

PastedFilled incurl -X POSThttps://api.example.com/items -H'Content-Type: application/json'-d '{"name":"Ada"}'curl -u ada:pw -H'Authorization: Bearer abc'https://x.test/a -o out.txtcurl -G https://x.test/s -dq=hi -d page=2curl -I example.com -k--retry 3POST, JSON body{"name":"Ada"}, Content-Typeline removedGET, Bearer token abc, note:-o not usedGET, query lines q=hi andpage=2HEAD, https:// added, note:--retry not used
Pasted to Filled incurl -X POST https://api.example.com/items -H'Content-Type: application/json' -d'{"name":"Ada"}'POST, JSON body {"name":"Ada"},Content-Type line removedcurl -u ada:pw -H 'Authorization:Bearer abc' https://x.test/a -o out.txtGET, Bearer token abc, note: -o notusedcurl -G https://x.test/s -d q=hi -dpage=2GET, query lines q=hi and page=2curl -I example.com -k --retry 3HEAD, https:// added, note: --retrynot used
Four real imports.

Support Matrix

Curl flags it reads

MethodURLHeadersAuthBodyQueryNot used-X-H-d-u-G-I-A-e-b-o
-XMethod-HHeadersAuth-dBodyQuery-uAuth-GQuery-IMethod-AHeaders-eHeaders
What each flag fills.

Pipeline

Reading a curl command

Join lines thatend in a backslashSplit into words,honoring quotesDrop the word curlRead each flag andits valueTake the firstbare word as theURLAdd https:// ifthere is no scheme
Join lines that end in a backslashSplit into words, honoring quotesDrop the word curlRead each flag and its valueTake the first bare word as theURLAdd https:// if there is no scheme
Steps in the import.

Pipeline

Picking the body type on import

Content-Type hasjson, or bodystarts with { or[: JSONContent-Typeurlencoded, ornone given: FormAnything else: Rawtext
Content-Type has json, or bodystarts with { or [: JSONContent-Type urlencoded, or nonegiven: FormAnything else: Raw text
From the Content-Type.

Before After

Download names

TabFilecurlfetchPythonNoderequest.shrequest.mjsrequest.pyrequest.mjs
Tab to Filecurlrequest.shfetchrequest.mjsPythonrequest.pyNoderequest.mjs
The file name follows the tab.

Authored Tiles

Four code styles

curlfetchPython requestsNode
curlfetchPython requestsNode
One request, four tabs.