Mock HTTP Response Builder
Build a raw HTTP response — status line, headers and body — from simple fields. Pick a status code, choose a body type (JSON, HTML, XML, plain text or form), auto-add Content-Type and Content-Length, and copy or download the full response for API mocking and testing.
Input
Optional override for the reason text after the status code.
Optional. Enter an HTTP-date (IMF-fixdate) to include a Date header; leave blank to omit it.
One header per line as "Header-Name: value". A custom header overrides its auto-generated counterpart (Content-Type, Content-Length, Date). Blank lines and lines without a colon are ignored.
Output
Guides
The Mock HTTP Response Builder assembles a complete, raw HTTP response — the status line, response headers and an optional body — from a handful of simple fields. Instead of hand-typing HTTP/1.1 200 OK, counting body bytes for Content-Length, and remembering the right Content-Type, you pick options and copy a spec-correct response you can paste into a mock server, a test fixture, an API doc, or a proxy rule.
What it produces
The tool outputs two artifacts side by side:
- Full HTTP Response — the status line, all headers, a blank line, and the body, joined with CRLF (
\r\n) line endings exactly as they travel on the wire. - Status Line + Headers Only — the same response with the body stripped, handy when you only need the header block.
Both are copyable and downloadable (as .http files).
How to use it
- Choose an HTTP version — HTTP/1.0, HTTP/1.1 or HTTP/2.
- Pick a status code from the searchable list (1xx through 5xx). Each code carries its standard reason phrase (for example
200 OK,404 Not Found), which you can override with a custom reason. - Select a body type — None, Plain Text, JSON, XML, HTML, or Form (urlencoded) — and enter the body content.
- Toggle the auto headers. With Auto-set Content-Type on, the correct
Content-Type(such asapplication/json; charset=utf-8) is added for the chosen body type. With Auto-calculate Content-Length on, the byte length of the body is computed for you. - Add a Date header by entering an HTTP-date, and add any custom headers — one
Header-Name: valueper line, such asCache-Control: no-cacheorSet-Cookie: session=abc123.
Auto-generated headers appear first, followed by your custom headers in the order you list them. A custom header takes precedence over its auto-generated counterpart, so writing your own Content-Type line replaces the automatic one.
Common use cases
- API mocking — produce a canned response for a stub server, service virtualization layer, or
mockoon/json-server-style fixture. - Testing and QA — craft the exact response your client should handle: a
429 Too Many Requests, a301redirect with aLocationheader, or a500error body. - Documentation — paste a realistic sample response into API docs or a README.
- Learning — see how the status line, headers and body fit together in the raw HTTP message format.
Why is Content-Length different from the character count?
Content-Length is measured in bytes (octets), not characters. Multi-byte UTF-8 characters count as more than one byte, so a body with accented letters or emoji will have a Content-Length larger than its visible length. This tool always counts UTF-8 bytes, matching what a real server sends.
Does HTTP/2 really use a status line?
On the wire, HTTP/2 replaces the status line with a binary :status pseudo-header and has no reason phrase. This builder keeps the familiar HTTP/1.x text layout for readability even when you select HTTP/2, so the output stays easy to read and paste — treat the HTTP/2 option as a label rather than a byte-accurate frame.
This tool runs entirely in your browser — nothing you type is sent to a server.