Mock HTTP Response Builder

ДанныеРазработчикНетворкинг
Реклама · УДАЛИТЬ?
Optional override for the reason text after the status code.

Пользовательские заголовки

Или добавить пользовательский

Headers Added

No custom headers added yet. Common headers (Content-Type, Content-Length, Date) are added automatically based on the options above.

Реклама · УДАЛИТЬ?

Гид

Mock HTTP Response Builder

Mock HTTP Response Builder

Construct a structurally correct HTTP response message in seconds. Pick a status code, choose a body type, add headers, and the tool emits a ready-to-paste response string with the status line, headers, and body separated by CRLF — perfect for test fixtures, integration mocks, API documentation, and replaying responses against clients.

Как использовать

  1. Выберите HTTP version (defaults to HTTP/1.1) and a status code from the grouped picker — for example 200 OK, 404 Not Found, или 503 Service Unavailable.
  2. (Optional) Override the reason phrase if you need a non-standard text after the status code.
  3. Выберите body type (Plain Text, JSON, XML, HTML, Form, or None) and type or paste the body.
  4. Переключать auto Content-Type, auto Content-Lengthи Дата headers to match how your server would respond.
  5. Add any extra headers — pick from common ones (Cache-Control, ETag, Set-Cookie, CORS, rate-limit headers) or type a custom name/value pair.
  6. Copy the full response, copy just the headers, or download it as a .http file for use in REST clients, fixtures, or replay tools.

Возможности

  • Grouped status code picker – Common 1xx through 5xx codes organized by class, each with its standard reason phrase.
  • Body type selector – Auto-fills the matching Content-Type (application/json, text/html, application/xml, application/x-www-form-urlencoded, text/plain) so headers and payload stay in sync.
  • Auto Content-Length – Counts bytes (not characters) using UTF-8 encoding, matching how real servers compute the value.
  • IMF-fixdate Date header – Generates a standards-compliant timestamp (e.g. Sun, 06 Nov 1994 08:49:37 GMT) for the current moment.
  • Common response headers – One-click presets for Cache-Control, ETag, Expires, Last-Modified, Location, Server, Set-Cookie, Vary, WWW-Authenticate, Access-Control-Allow-Origin, X-RateLimit, and X-Powered-By.
  • Пользовательские заголовки – Add any name/value pair, with live preview of the assembled response.
  • Two output views – Full response (status line + headers + blank line + body) and headers-only — copy either, or download the full response as response.http.
  • Spec-correct line endings – Uses CRLF (\r\n) between lines, the line terminator mandated by RFC 9112.
  • – вывод и проверка обновляются в реальном времени при вводе или изменении параметров. – Every change recomputes the output instantly; no submit button needed.
  • Работает полностью в браузере – No data leaves your machine and no backend is involved.

Распространенные случаи использования

  • Unit and integration test fixtures – Paste the output into a string fixture for requests-mock, nock, MSW, WireMock, or any HTTP recorder.
  • API documentation – Show an exact response shape (with headers) in OpenAPI examples or developer docs.
  • Client debugging – Reproduce a rare server response (rate limited, partial content, redirect) without standing up a real backend.
  • Teaching HTTP – Visualize the on-the-wire format of a response message: status line, headers, blank line, body.
  • Manual replay – Pipe the response into nc -l or a similar listener to test how a client reacts.

Часто задаваемые вопросы

  1. What is the structure of an HTTP/1.1 response message?

    An HTTP/1.1 response consists of a status line, zero or more header fields, an empty line, and an optional message body. The status line is the HTTP version, the three-digit status code, and a reason phrase separated by single spaces. Every line is terminated by CRLF (carriage return + line feed). The blank CRLF after the last header marks the start of the body. This format is defined in RFC 9112 (the successor to RFC 7230).

  2. What does Content-Length actually measure, bytes or characters?

    Content-Length is the length of the message body in octets (bytes), not characters. For ASCII text the two values match, but for any UTF-8 string containing non-ASCII characters they diverge — a single emoji or accented letter typically uses 2–4 bytes. Computing Content-Length from the character count of a string is one of the most common HTTP bugs and will cause clients to either truncate the body or hang waiting for missing bytes.

  3. What is the difference between a 301 and a 302 redirect?

    Both responses include a Location header pointing to a new URL, but the semantics are different. A 301 Moved Permanently tells clients and search engines that the resource has been relocated for good, so caches and link rewriters may replace the original URL. A 302 Found (originally 'Moved Temporarily') signals a temporary redirect — the original URL should still be used in future. For modern method-preserving redirects, 308 (permanent) and 307 (temporary) are usually preferred over 301 and 302.

  4. Does HTTP/2 still use status lines and reason phrases?

    HTTP/2 keeps the same numeric status codes but drops the textual reason phrase entirely. The status is delivered as a pseudo-header field (:status: 200), and the protocol is framed in binary rather than line-oriented text. Reason phrases survive only in HTTP/1.x and have always been informational — clients are required to act on the status code, not the text.

  5. Why does HTTP require CRLF instead of just a newline?

    HTTP inherits its line-termination convention from the older Internet text protocols (SMTP, NNTP, FTP) defined in the 1980s, all of which use CRLF (\r\n) as the canonical end-of-line. The grammar in RFC 9112 requires CRLF between the start-line, header fields, and the empty line preceding the body. Most servers are tolerant of a bare LF, but strict parsers and proxies may reject responses that omit the carriage return.

Хотите убрать рекламу? Откажитесь от рекламы сегодня

Установите наши расширения

Добавьте инструменты ввода-вывода в свой любимый браузер для мгновенного доступа и более быстрого поиска

в Расширение Chrome в Расширение края в Расширение Firefox в Расширение Opera

Табло результатов прибыло!

Табло результатов — это интересный способ следить за вашими играми, все данные хранятся в вашем браузере. Скоро появятся новые функции!

Реклама · УДАЛИТЬ?
Реклама · УДАЛИТЬ?
Реклама · УДАЛИТЬ?

новости с техническими моментами

Примите участие

Помогите нам продолжать предоставлять ценные бесплатные инструменты

Купи мне кофе
Реклама · УДАЛИТЬ?