| |

3 .

3.1 HTTP.

HTTP "<major>.<minor>", . , HTTP , - . , , , , . , , , <Minor> . <Major> .

HTTP HTTP-version .

          HTTP-Version   = "HTTP" "/" 1*DIGIT "." 1*DIGIT

, major minor . , HTTP/2.4 - , HTTP/2.13, HTTP/12.3. .

, , , HTTP (HTTP-version) "HTTP/1.1". , .

HTTP - HTTP , .

, - , , . , , -/ , , HTTP ; , -/ , , . , , HTTP -/ ; -/ major , .

: HTTP , .

3.2 (URI).

URI : WWW , , (URI), , , (Uniform Resource Locators, URL) (Uniform Resource Names, URN). HTTP URL , - , , - .

3.2.1 .

URI HTTP (absolute) URI (relative), . , URI .

          URI         = ( absoluteURI | relativeURI ) [ "#" fragment ]

          absoluteURI = scheme ":" *( uchar | reserved )

          relativeURI = net_path | abs_path | rel_path

          net_path    = "//" net_loc [ abs_path ]
          abs_path    = "/" rel_path
          rel_path    = [ path ] [ ";" params ] [ "?" query ]

          path        = fsegment *( "/" segment )
          fsegment    = 1*pchar
          segment     = *pchar

          params      = param *( ";" param )
          param       = *( pchar | "/" )

          scheme      = 1*( ALPHA | DIGIT | "+" | "-" | "." )
          net_loc     = *( pchar | ";" | "?" )

          query       = *( uchar | reserved )
          fragment    = *( uchar | reserved )

          pchar       = uchar | ":" | "@" | "&" | "=" | "+"
          uchar       = unreserved | escape
          unreserved  = ALPHA | DIGIT | safe | extra | national

          escape      = "%" HEX HEX
          reserved    = ";" | "/" | "?" | ":" | "@" | "&" | "=" | "+"
          extra       = "!" | "*" | "'" | "(" | ")" | ","
          safe        = "$" | "-" | "_" | "."
          unsafe      = CTL | SP | <"> | "#" | "%" | "<" | ">"
          national    = < OCTET   ALPHA, DIGIT,
                           reserved, extra, safe,  unsafe>

URL RFC 1738 [4] RFC 1808 [11]. - , URL ( RFC 1738), HTTP rel_path , , , HTTP - URI, RFC 1738.

HTTP a priori URI. URI , , URI , , GET, URI. 414 (URI , Request-URI Too Long), URI , ( 10.4.15).

: URI, 255 , - .

3.2.2 HTTP URL.

"Http" HTTP. - HTTP URL.

          http_URL       = "http:" "//" host [ ":" port ] [ abs_path ]

          host           = <   
                             IP  ( - ),
                                2.1 RFC 1123>

          port           = *DIGIT

- 80. , , TCP port, host, URI - abs_path. IP URL , ( RFC 1900 [24]). abs_path URL, "/" URI (Request-URI) ( 5.1.2).

3.2.3 URI.

URI, , (octet-by-octet) URI, :

, , "" ("reserved") "" ("unsafe") (. 3.2) ""%" HEX HEX ".

URI :

         http://abc.com:80/~smith/home.html
         http://ABC.com/%7Esmith/home.html
         http://ABC.com:/%7esmith/home.html

3.3 /.

3.3.1 .

HTTP /:

      Sun, 06 Nov 1994 08:49:37 GMT  ; RFC 822,   RFC 1123
      Sunday, 06-Nov-94 08:49:37 GMT ; RFC 850,   RFC 1036
      Sun Nov  6 08:49:37 1994       ;  asctime() ANSI C

, RFC 1123 ( RFC 822). , RFC 850 [12], , , . HTTP/1.1, , ( HTTP/1.0), HTTP RFC 1123 .

: , , , , HTTP , -/ SMTP NNTP.

HTTP / Greenwich Mean Time (GMT). "GMT" . asctime() .

          HTTP-date    = rfc1123-date | rfc850-date | asctime-date

          rfc1123-date = wkday "," SP date1 SP time SP "GMT"
          rfc850-date  = weekday "," SP date2 SP time SP "GMT"
          asctime-date = wkday SP date3 SP time SP 4DIGIT

          date1        = 2DIGIT SP month SP 4DIGIT
                         ;    ( 02 Jun 1982)

          date2        = 2DIGIT "-" month "-" 2DIGIT
                         ; -- ( 02-Jun-82)

          date3        = month SP ( 2DIGIT | ( SP 1DIGIT ))
                         ;   (, Jun  2)

          time         = 2DIGIT ":" 2DIGIT ":" 2DIGIT
                         ; 00:00:00 - 23:59:59

          wkday        = "Mon" | "Tue" | "Wed"
                       | "Thu" | "Fri" | "Sat" | "Sun"

          weekday      = "Monday" | "Tuesday" | "Wednesday"
                       | "Thursday" | "Friday" | "Saturday" | "Sunday"

          month        = "Jan" | "Feb" | "Mar" | "Apr"
                       | "May" | "Jun" | "Jul" | "Aug"
                       | "Sep" | "Oct" | "Nov" | "Dec"

: - /, HTTP. , ..

3.3.2 (delta seconds).

HTTP , , , .

          delta-seconds  = 1*DIGIT

3.4 (character sets).

HTTP " ", MIME:

" " , , . , , , . , US-ASCII , , , ISO 2022. , MIME , . .

: " " " ". , HTTP MIME , , .

HTTP , . IANA [19].

          charset = token

HTTP charset , , IANA, , . , IANA.

3.5 (content codings).

. . , , , .

          content-coding   = token

(content-coding) . HTTP/1.1 (content-coding) Accept-Encoding ( 14.3) Content-Encoding ( 14.12). , , - , .

Internet Assigned Numbers Authority (IANA) (content-coding). :

gzip
, "gzip" (GNU zip), RFC 1952 [25]. Lempel-Ziv (LZ77) 32 CRC.
compress
, "compress" UNIX . Lempel-Ziv-Welch (LZW).

: . , . HTTP, "x-gzip" "x-compress" "gzip" "compress" .

deflate
zlib, RFC 1950 [31], "deflate", RFC 1951 [29].

(content-coding) ; , , , , .

3.6 (Transfer Codings).

, (entity-body) " " . , - , .

          transfer-coding         = "chunked" | transfer-extension

          transfer-extension      = token

(transfer-coding) . HTTP/1.1 (transfer-coding) Transfer-Encoding ( 14.40).

- Content-Transfer-Encoding MIME, 7- . 8- . HTTP ( 7.2.2), .

(chunked encoding) , , , . , .

       Chunked-Body   = *chunk
                        "0" CRLF
                        footer
                        CRLF

       chunk          = chunk-size [ chunk-ext ] CRLF
                        chunk-data CRLF

       hex-no-zero    = <HEX   "0">

       chunk-size     = hex-no-zero *HEX
       chunk-ext      = *( ";" chunk-ext-name [ "=" chunk-ext-value ] )
       chunk-ext-name = token
       chunk-ext-val  = token | quoted-string
       chunk-data     = chunk-size(OCTET)

       footer         = *entity-header

(chunked encoding) , , . , ; , , Content-MD5 HTTP .

Chunked-Body 19.4.6.

HTTP/1.1 " " ("chunked" transfer coding), , . , , , 501 ( , Not Implemented) . (transfer-coding) HTTP/1.0 .

3.7 (Media Types).

HTTP (Internet Media Types) Content-Type ( 14.18) Accept ( 14.1) .

          media-type     = type "/" subtype *( ";" parameter )
          type           = token
          subtype        = token

type/subtype / (attribute/value).

          parameter      = attribute "=" value
          attribute      = token
          value          = token | quoted-string

, , . , , . (LWS) , . , , ( ) MIME, , .

: HTTP . HTTP /.

- Internet Assigned Number Authority (IANA). RFC 2048 [17]. .

3.7.1 text.

. , , HTTP , ; "text", .

"text" CRLF . HTTP , CR LF , (entity-body). HTTP CRLF, CR, LF , HTTP. , , 13 10 CR LF , , HTTP , CR LF . ; CR LF CRLF HTTP ( multipart).

Content-Encoding, .

"charset" ( 3.4), . "charset" , HTTP "text" "charset", "ISO-8859-1". , "ISO-8859-1" "charset".

HTTP/1.0 Content-Type "charset" , " ". , "charset" charset ISO-8859-1 , , .

, HTTP/1.0 "charset". HTTP/1.1 "charset", ; , "" charset charset content-type, charset, .

3.7.2 Multipart.

MIME "multipart" - . mulptipart , MIME [7], . - , , RLF (body-parts). MIME, multipart ; HTTP ( multipart ).

HTTP (body-parts) multipart , . Content-Location ( 14.15) (body-part) , URL.

, HTTP , MIME multipart. multipart, "multipart/mixed".

: "multipart/form-data" , POST, RFC 1867 [15].

3.8 (Product Tokens).

, . , , , . , .

          product         = token ["/" product-version]
          product-version = token

:

          User-Agent: CERN-LineMode/2.15 libwww/2.17b3
          Server: Apache/0.8.4

- . product-version , ( , product-version product.

3.9 (Quality Values).

HTTP ( 12) " " ("") . - 0 1, 0 - , 1 - . HTTP/1.1 . .

          qvalue         = ( "0" [ "." 0*3DIGIT ] )
                         | ( "1" [ "." 0*3("0") ] )

" " - , .

3.10 (Language Tags).

: , , . . HTTP Accept-Language Content-Language.

HTTP , RFC 1766 [1]. , : , , :

           language-tag  = primary-tag *( "-" subtag )

           primary-tag   = 1*8ALPHA
           subtag        = 1*8ALPHA

. IANA. :

          en, en-US, en-cockney, i-cherokee, x-pig-latin

ISO 639, ISO 3166. ( - ; , - , .)

3.11 (Entity Tags).

. HTTP/1.1 ETag ( 14.20), If-Match ( 14.25), If-None-Match ( 14.26), If-Range ( 14.27). , 13.3.3. (opaque quoted string), (weakness indicator).

         entity-tag = [ weak ] opaque-tag

         weak       = "W/"
         opaque-tag = quoted-string

" " ("strong entity tag") , .

" " ("weak entity tag"), "W/", . .

, . , URI .

3.12 (Range Units).

HTTP/1.1 . HTTP/1.1 Range ( 14.36) Content-Range ( 14.17). .

         range-unit       = bytes-unit | other-range-unit

         bytes-unit       = "bytes"
         other-range-unit = token

, HTTP/1.1 - "bytes". HTTP/1.1 , . HTTP/1.1 , , .


Copyright  ©  1998 Alex Simonoff (http://www.omsk.com/Leshik/), All Rights Reserved.


| |