HTTP/1.1 (source code)

= HTTP/1.1
{c}

<HTTP 1.1> is a version of the <Hypertext Transfer Protocol> with a specified message syntax, parsing rules and connection behavior. Its shared method and status meanings come from the broader HTTP semantics; its concrete messages use a start line, field lines, an empty line and any permitted message body.<HTTP 1.1 (RFC 9112)>[Abstract and §2.1, Message Format]{ref}

A short response can be represented with visible escape notation as `HTTP/1.1 200 OK\r\nContent-Length: 4\r\n\r\nblue`. Here `\r\n` denotes the carriage-return/line-feed pair in the actual byte stream, rather than four literal characters. The body is the four bytes spelling `blue`; the empty line separates it from the header section.

This illustrates <HTTP message framing>: a recipient needs rules for locating the end of one message before interpreting subsequent bytes. In this example, the declared content length identifies four body bytes. Other permitted cases have their own framing rules; a line break inside body data is not automatically a new message.<HTTP 1.1 (RFC 9112)>[§§2.1 and 6, message format and body length]{ref}

An <HTTP persistent connection> can carry multiple exchanges rather than requiring a fresh connection for each message. Persistence does not imply that a previous request's method or target is silently inherited by the next one; each request still has its own defined control information.<HTTP 1.1 (RFC 9112)>[§9.3, persistence]{ref}

Distinguish this wire format from the abstract <HTTP request> and <HTTP response>. A different HTTP version can encode control information differently while retaining shared meanings such as `GET` or status `200`. Likewise, the protocol version alone does not identify the <media type> of a returned representation.