[Next] [Previous] [Up] [Top] [Full Contents] [Search]
4. HTTP Message
4.2 Message Headers
HTTP header fields, which include General-Header (Section 4.3), Request-Header (Section 5.4), Response-Header (Section 6.3), and Entity-Header (Section 7.1) fields, follow the same generic format as that given in Section 3.1 of RFC 822 [8]. Each header field consists of a name followed by a colon (":") and the field value. The field value may be preceded by any amount of LWS, though a single SP is preferred. Header fields can be extended over multiple lines by preceding each extra line with at least one LWS.
HTTP-header = field-name ":" [ field-value ] CRLF
field-name = 1*<any CHAR, excluding CTLs, SP, and ":">
field-value = *( field-content | comment | LWS )
field-content = <the OCTETs making up the field-value
and consisting of either *text or combinations
of token, tspecials, and quoted-string>
The order in which header fields are received is not significant. However, it is considered "good practice" to send General-Header fields first, followed by Request-Header or Response-Header fields prior to the Entity-Header fields. Comments can be included in HTTP header fields by surrounding the comment text with parentheses.
comment = "(" *( ctext | comment ) ")"
ctext = <any text excluding "(" and ")">
Note
Use of comments within HTTP headers is generally discouraged, since they are rarely seen by human eyes and hence only increase network traffic. However, they may be useful for messages posted or retrieved via NNTP and SMTP gateways.
T. Berners-Lee, R. T. Fielding, H. Frystyk Nielsen - 12 MAR 95
[Next] [Previous] [Up] [Top] [Full Contents] [Search]
Generated with CERN WebMaker