HTTP Response

From NovaOrdis Knowledge Base
Jump to navigation Jump to search

External

Internal

Overview

A HTTP response consists of a status line, followed by an optional set of headers, followed by blank line followed by an optional message body.

This is a simple example:

HTTP/1.1 200 OK
Content-Type: text/html
HttpServer: Test Server
Content-Length: 1024

...
...

The Response Status Line

The status line starts with the protocol version followed by a numeric status code and its associated reason phrase, with each element separated by space. No CR or LF is allowed except in the final CRLF sequence.

For more details about the status code, see

HTTP Status Codes

Example:

HTTP/1.1 200 OK

The Headers

General Headers

Response Headers

The response-header fields allow the server to pass additional information about the response which cannot be placed in the Status- Line. These header fields give information about the server and about further access to the resource identified by the Request-URI.

      response-header = Accept-Ranges           ; Section 14.5
                      | Age                     ; Section 14.6
                      | ETag                    ; Section 14.19
                      | Location                ; Section 14.30
                      | Proxy-Authenticate      ; Section 14.33
                      | Retry-After             ; Section 14.37
                      | Server                  ; Section 14.38
                      | Vary                    ; Section 14.44
                      | WWW-Authenticate        ; Section 14.47


Entity Headers

The Blank Line

The Message Body

More about HTTP response: http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html.

The HTTP Response Headers

HTTP Response Entity Body