HttpResponse
An HTTP response is the message a server sends to a client in reply to an HTTP request. It is composed of three parts: a status line, a set of headers, and an optional message body. The status line includes the HTTP version, a three-digit status code, and a reason phrase, for example "HTTP/1.1 200 OK".
Status codes indicate the result of the request and are grouped by numerical range: 1xx informational, 2xx
Headers convey metadata about the response or about the body, such as Content-Type (media type), Content-Length
Connection management: HTTP/1.1 default is to use persistent connections; the Connection header can request closing. The
In practice, clients process the status line and headers to decide how to handle the body, caching,
With HTTP/2 and HTTP/3, responses are multiplexed over a single connection and header compression reduces overhead,