4 HTTP (HTTP Message).
4.1 .
HTTP .
HTTP-message = Request | Response ; HTTP/1.1
( 5) ( 6) RFC 822 [9] ( ). : (start-line), ( ""), ( , CRLF), , , , .
generic-message = start-line *message-header CRLF [ message-body ] start-line = Request-Line | Status-Line
, , (Request-Line). , CRLF, CRLF .
: HTTP/1.0 CRLF POST. , -. HTTP/1.1 CRLF .
4.2 .
HTTP, (general-header) ( 4.5), (request-header) ( 5.3), (response-header) ( 6.2), (entity-header) ( 7.1), , 3.1 RFC 822 [9]. , (":") . . LWS, SP. . SP HT. " " ("common form") HTTP , , - .
message-header = field-name ":" [ field-value ] CRLF field-name = token field-value = *( field-content | LWS ) field-content = <, *TEXT , tspecials, quoted-string>
, . " " , , , , , .
, , , , [ #(value)]. " : " ( ) . , , , , , - .
4.3 c.
HTTP (message-body), , , . (message-body) (entity-body) , , Transfer-Encoding ( 14.40).
message-body = entity-body | <entity-body Transfer-Encoding>
Transfer-Encoding , . Transfer-Encoding - , , , , /.
, , .
Content-Length Transfer-Encoding. (message-body) (entity-body) ( 5.1.1).
(message-body) , ( 6.1.1). HEAD (message-body), (entity-header), . 1xx (), 204 ( , No Content), 304 ( , Not Modified) (message-body). , .
4.4 .
(message-body) , ( ):
- , (message-body) ( 1xx, 204, 304 HEAD) , (entity-header fields), .
- Transfer-Encoding ( 14.40) "chunked", (chunked encoding) ( 3.6).
- Content-Length ( 14.14) , (message-body) .
- "multipart/byteranges", , . , , ; Range (byte-range) , multipart/byteranges .
- . ( , ).
HTTP/1.0 HTTP/1.1 , (message-body) Content-Length, , HTTP/1.1 . (message-body), Content-Length , 400 ( , Bad Request), , 411 ( , Length Required), Content-Length.
HTTP/1.1 , , "chunked" ( 3.6), , .
Content-Length "chunked". Content-Length "chunked", Content-Length .
Content-Length , (message-body), . HTTP/1.1 .
4.5 .
, , , . .
general-header = Cache-Control ; 14.9 | Connection ; 14.10 | Date ; 14.19 | Pragma ; 14.32 | Transfer-Encoding ; 14.40 | Upgrade ; 14.41 | Via ; 14.44
(general-header fields) . , (general-header fields), . (entity-header).