HTTP Request Builder
Compose a well-formed HTTP/1.1 request message from a method, target, headers and body without sending it.
- Runs locally in your browser
- No upload required
Try it
Supported formats
Privacy
Runs entirely in your browser. Your input is never uploaded, stored, or sent to a third party.
Built a request message starting with "POST /api/items HTTP/1.1" and 3 header line(s).
How it works
- Wrote the request line as method, target and HTTP version.
- Normalized each header line to `Name: value` and added a Host line when one was missing.
- Added Content-Length: 17 because a body was present and no length or transfer-encoding was supplied.
- Joined the start line, header block and optional body into one message.
- The message is text only. This tool never opens a socket and never sends the request.
- Header order is preserved except for an injected Host line, which is placed first.
Methodology
- Upper-case the method and write the request line as method, target and version.
- Parse the header block into `Name: value` lines and preserve their order.
- Inject a Host line first when the caller did not supply one.
- Compute the UTF-8 byte length of the body and inject Content-Length when a body exists and no length or transfer-encoding header was supplied.
- Serialize the start line, normalized header block and optional body into the final message.
Usage
- Choose the method and the HTTP version.
- Enter the request target (a path such as /api/items, or an absolute URL).
- Add one header per line as `Name: value`; Host and Content-Length are added when missing.
- Optionally add a body, then copy the generated request message.
Examples
These are examples, not current values: they use fixed inputs, while the interactive tool computes live results in your browser.
POST with a JSON body
{
"method": "POST",
"target": "/api/items",
"version": "HTTP/1.1",
"headers": "Host: api.example.com\nContent-Type: application/json",
"body": "{\"name\":\"widget\"}"
}GET without a body
{
"method": "GET",
"target": "/search?q=hello",
"version": "HTTP/1.1",
"headers": "Host: example.com\nAccept: application/json",
"body": ""
}Limitations
A message, not a connection
An HTTP message is a request line or status line, a header block, and an optional body. That text form is what HTTP/1.1 puts on the wire. Building it by hand is useful for documentation, teaching and debugging, but it deliberately stops short of the connection: DNS, TLS, framing and connection reuse are all omitted.
Host and Content-Length
Host became mandatory in HTTP/1.1 because one server address can host many names; a request without it is invalid. Content-Length tells the receiver how many body bytes follow. The builder injects both only when they are missing and never overwrites a value you supplied, so an intentional Transfer-Encoding or a fixed length is preserved.
Frequently asked questions
- Does this send the request?
- No. It builds the exact text a client would send. Nothing leaves the browser, and no server is contacted.
- Why was a Host header added?
- HTTP/1.1 requires a Host header on every request. If you did not supply one, the tool adds an empty Host line so the message is structurally valid and you can fill it in.
- When is Content-Length added?
- When you supply a body and no Content-Length or Transfer-Encoding header. The value is the UTF-8 byte length of the body, not the character count.
Sources
- RFC 9112 — HTTP/1.1 — IETF
- RFC 9110 — HTTP Semantics — IETF
- MDN Web Docs — HTTP messages — MDN
Send feedback
Tell us if this tool helped, report a problem, or suggest a tool. Only the message you type is sent — never the input you used in the tool.
Was this tool useful?
Prefer to write to us directly? See the contact page.