HTTP Response: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
 
(14 intermediate revisions by the same user not shown)
Line 25: Line 25:
=The Response Status Line=
=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.
The status line starts with the [[#Protocol_Version|protocol version]] followed by a numeric [[#Status_Code|status code]] and its associated [[Reason_Phrase|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 {{Internal|HTTP Status Codes|HTTP Status Codes}}
Example:
 
HTTP/1.1 200 OK
 
==Protocol Version==


Example:
==Status Code==


<pre>
The '''status code''' is also called '''response code'''.
HTTP/1.1 200 OK
</pre>


=The Headers=
For more details about the status code, see {{Internal|HTTP Status Codes|HTTP Status Codes}}


==General Headers==
==Reason Phrase==


==Response Headers==
=The 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.
{{External2|http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html|http://en.wikipedia.org/wiki/List_of_HTTP_headers}}


      response-header = Accept-Ranges          ; Section 14.5
The headers included with a response are part of one of the following category:
                      | 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


==General Headers==


==Entity Headers==
{{Internal|General HTTP Header Fields|General Headers}}


=The Blank Line=
==Response Headers==


=The Message Body=
The response headers allow the server to pass additional information about the response which cannot be placed in the status line.


* [[HTTP Response Header Accept-Ranges|Accept-Ranges]]
* [[HTTP Response Header Age|Age]]
* [[HTTP Response Header ETag|ETag]]
* [[HTTP Response Header Location| Location]]
* [[HTTP Response Header Proxy-Authenticate|Proxy-Authenticate]]
* [[HTTP Response Header Retry-After|Retry-After]]
* [[HTTP Response Header Server| Server]]
* [[HTTP Response Header Vary|Vary]]
* [[HTTP Response Header WWW-Authenticate|WWW-Authenticate]]


==Entity Headers==


{{Internal|Entity HTTP Header Fields|Entity Headers}}


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


=The HTTP Response Headers=
=The HTTP Response Body=


* http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
The optional response body is referred to as the '''HTTP entity''':
* http://en.wikipedia.org/wiki/List_of_HTTP_headers


=HTTP Response Entity Body=
{{Internal|HTTP Entity|HTTP Entity}}

Latest revision as of 19:21, 26 September 2018

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.

Example:

HTTP/1.1 200 OK

Protocol Version

Status Code

The status code is also called response code.

For more details about the status code, see

HTTP Status Codes

Reason Phrase

The Headers

http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
http://en.wikipedia.org/wiki/List_of_HTTP_headers

The headers included with a response are part of one of the following category:

General Headers

General Headers

Response Headers

The response headers allow the server to pass additional information about the response which cannot be placed in the status line.

Entity Headers

Entity Headers

The Blank Line

The HTTP Response Body

The optional response body is referred to as the HTTP entity:

HTTP Entity