HTTP Response: Difference between revisions
(3 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. | ||
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 {{Internal|HTTP Status Codes|HTTP Status Codes}} | For more details about the status code, see {{Internal|HTTP Status Codes|HTTP Status Codes}} | ||
==Reason Phrase== | |||
=The Headers= | =The Headers= | ||
Line 65: | Line 71: | ||
=The Blank Line= | =The Blank Line= | ||
=The | =The HTTP Response Body= | ||
The optional response body is referred to as the '''HTTP entity''': | |||
{{Internal|HTTP Entity|HTTP Entity}} |
Latest revision as of 19:21, 26 September 2018
External
- RFC 2616 Section 6 Response https://www.w3.org/Protocols/rfc2616/rfc2616-sec6.html
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
Reason Phrase
The Headers
The headers included with a response are part of one of the following category:
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
The Blank Line
The HTTP Response Body
The optional response body is referred to as the HTTP entity: