:


Network Working Group                                      R. Fielding
Request for Comments: 2068                                   UC Irvine
Category: Standards Track                                    J. Gettys
                                                              J. Mogul
                                                                   DEC
                                                            H. Frystyk
                                                        T. Berners-Lee
                                                               MIT/LCS
                                                            1997


                     -- HTTP/1.1

 .

       RFC 2068   . 
          ,  
     ,   ,  
    .       
   ,       , 
   "" (    "" ,   
      ).   : 
    , ,      
         -   
    Leshik@omsk.com .

        ,   , ,
    .      
     . :  (request).

        .

         ,   
        
    .      
     ( -    ),
             
     (      
    ).

                                                 .

  .

         
   (Internet standards track protocol)   , 
         .
        " 
    " (STD 1)    
      .   
   .


.

      (HTTP) -   
    , ,   .
    , -, - ,
        ,   
        , 
     .

    HTTP -      ,
         .

   HTTP   World Wide Web (WWW)   1990 . 
     ,   "HTTP/1.1".


.

   1  ................................................7
    1.1  .................................................7
    1.2  ...........................................7
    1.3  .........................................8
    1.4   ......................................11
   2      ..........13
    2.1    - (BNF) ....13
    2.2   ....................................15
   3   ....................................17
    3.1  HTTP .........................................17
    3.2    (URI) .........18
     3.2.1   ..................................18
     3.2.2 HTTP URL .........................................19
     3.2.3  URI ....................................20
    3.3  / ................................21
     3.3.1   ......................................21
     3.3.2   (delta seconds) ..................22
    3.4   (character sets) ....................22
    3.5   (content codings) ...........23
    3.6   (transfer codings) .............24
    3.7   (Media Types) ............................25
     3.7.1     
           text .............................................26
     3.7.2  Multipart ...................................27
    3.8   (Product Tokens) ...................28
    3.9   (Quality Values) ..............28
    3.10   (Language Tags) .......................28
    3.11   (Entity Tags) .......................29
    3.12    (Range Units) .........30
   4 HTTP  (HTTP Message) ..........................30
    4.1   ......................................30
    4.2   .................................31
    4.3  c ......................................32
    4.4   .....................................32
    4.5    ................................34
   5  (Request) .......................................34
    5.1   (Request-Line) .......................34
     5.1.1  (Method) ...................................35
     5.1.2  URI (Request-URI) ..................35
    5.2 ,   ...................37
    5.3    ..............................37
   6  (Response) .......................................38
    6.1   (Status-Line) ......................38
     6.1.1      .................39
    6.2    ...............................41
   7  (Entity) ........................................41
    7.1    ..............................41
    7.2   ........................................42
     7.2.1  (Type) .......................................42
     7.2.2  (Length) ...................................43
   8  (Connections) ...............................43
    8.1   (Persistent Connections) ......43
     8.1.1  .............................................43
     8.1.2   ...................................44
     8.1.3 - (Proxy Servers) ...................45
     8.1.4  c ..........................45
    8.2     .....................46
   9   (Method Definitions) ...............48
?    9.1   Idempotent  ......................48
     9.1.1   ................................48
?     9.1.2 Idempotent  (Idempotent Methods) ...........49
    9.2 OPTIONS .............................................49
    9.3 GET .................................................50
    9.4 HEAD ................................................50
    9.5 POST ................................................51
    9.6 PUT .................................................52
    9.7 DELETE ..............................................53
    9.8 TRACE ...............................................53
   10    ..............................53
    10.1 1xx -   ..........................54
     10.1.1 100 , Continue ........................54
     10.1.2 101  , Switching
                Protocols ...................................54
    10.2 2xx -   ................................54
     10.2.1 200  ..........................................54
     10.2.2 201 , Created .............................55
     10.2.3 202 , Accepted ...........................55
     10.2.4 203   , Non-Authoritative
                Information .................................55
     10.2.5 204  , No Content .................55
     10.2.6 205  , Reset Content ..........56
     10.2.7 206  , Partial Content .......56
    10.3 3xx -   .........................56
     10.3.1 300  , Multiple Choices .......57
     10.3.2 301  , Moved Permanently ......57
     10.3.3 302  , Moved Temporarily .......58
     10.3.4 303  , See Other ..................58
     10.3.5 304  , Not Modified ..............58
     10.3.6 305  -, Use Proxy ........59
    10.4 4xx -    ..........................59
     10.4.1 400  , Bad Request .............60
     10.4.2 401 , Unauthorized ............60
     10.4.3 402  , Payment Required ..........60
     10.4.4 403 , Forbidden ........................60
     10.4.5 404  , Not Found ........................60
     10.4.6 405   , Method Not Allowed .......61
     10.4.7 406  , Not Acceptable .................61
     10.4.8 407    
                -, Proxy Authentication
                Required ....................................61
     10.4.9 408    , Request
                Timeout .....................................62
     10.4.10 409 , Conflict .........................62
     10.4.11 410 , Gone ...............................62
     10.4.12 411  , Length Required ...........63
     10.4.13 412  , Precondition Failed ...63
     10.4.14 413    , Request
                 Entity Too Large ...........................63
     10.4.15 414 URI   , Request-URI
                 Too Long ...................................63
     10.4.16 415   , Unsupported
                 Media Type .................................63
    10.5 5xx -    ..........................64
     10.5.1 500   , Internal Server
                Error .......................................64
     10.5.2 501  , Not Implemented .............64
     10.5.3 502  , Bad Gateway ...................64
     10.5.4 503  , Service Unavailable ......64
     10.5.5 504     , Gateway
                Timeout .....................................64
     10.5.6 505    HTTP, HTTP Version
                Not Supported ...............................65
   11    (Access
      Authentication) .......................................65
    11.1     (Basic
         Authentication Scheme) .............................66
    11.2     (Digest
         Authentication Scheme) .............................67
   12   (Content Negotiation) ..........67
    12.1    ....................68
    12.2    .....................69
    12.3   ..............................70
   13   HTTP ....................................70
     13.1.1   ........................72
     13.1.2  ..................................73
     13.1.3    ......................74
     13.1.4   User Agent .................74
     13.1.5      ...........75
     13.1.6    ..............75
    13.2   .................................75
     13.2.1 ,   .............75
     13.2.2   .......................76
     13.2.3   .............................77
     13.2.4   ..........................79
     13.2.5    ...............80
     13.2.6 Disambiguating Multiple Responses ...............80
    13.3   (validation model) ................81
     13.3.1    (Last-modified Dates)..82
     13.3.2     ................82
     13.3.3     ......................82
     13.3.4     
     (Entity Tags)     (Last-
     modified Dates).........................................85
     13.3.5   ...........................86
    13.4 Cachability  .................................86
    13.5     ........................87
     13.5.1  (End-to-end)   (Hop-by-hop)
      ..............................................88
     13.5.2   ......................88
     13.5.3   ..........................89
     13.5.4    ..................90
    13.6    (Negotiated
    Responses)...............................................90
    13.7     ...............91
    13.8      
     .................................................91
    13.9   GET  HEAD ........................92
    13.10      .............92
    13.11 Write-Through Mandatory ...........................93
    13.12   .......................................93
    13.13  history ....................................93
   14    ...........................94
    14.1 Accept .............................................95
    14.2 Accept-Charset .....................................97
    14.3 Accept-Encoding ....................................97
    14.4 Accept-Language ....................................98
    14.5 Accept-Ranges ......................................99
    14.6 Age ................................................99
    14.7 Allow .............................................100
    14.8 Authorization .....................................100
    14.9 Cache-Control .....................................101
     14.9.1   (Cachable) .......................103
     14.9.2      .................103
     14.9.3     ....104
     14.9.4     
       ..............................105
     14.9.5  No-Transform .........................107
     14.9.6     ............108
    14.10 Connection .......................................109
    14.11 Content-Base .....................................109
    14.12 Content-Encoding .................................110
    14.13 Content-Language .................................110
    14.14 Content-Length ...................................111
    14.15 Content-Location .................................112
    14.16 Content-MD5 ......................................113
    14.17 Content-Range ....................................114
    14.18 Content-Type .....................................116
    14.19 Date .............................................116
    14.20 ETag .............................................117
    14.21 Expires ..........................................117
    14.22 From .............................................118
    14.23 Host .............................................119
    14.24 If-Modified-Since ................................119
    14.25 If-Match .........................................121
    14.26 If-None-Match ....................................122
    14.27 If-Range .........................................123
    14.28 If-Unmodified-Since ..............................124
    14.29 Last-Modified ....................................124
    14.30 Location .........................................125
    14.31 Max-Forwards .....................................125
    14.32 Pragma ...........................................126
    14.33 Proxy-Authenticate ...............................127
    14.34 Proxy-Authorization ..............................127
    14.35 Public ...........................................127
    14.36 Range ............................................128
     14.36.1   (byte ranges) ..................128
     14.36.2   (Range Retrieval
     Requests) .............................................130
    14.37 Referer ..........................................131
    14.38 Retry-After ......................................131
    14.39 Server ...........................................132
    14.40 Transfer-Encoding ................................132
    14.41 Upgrade ..........................................132
    14.42 User-Agent .......................................134
    14.43 Vary .............................................134
    14.44 Via ..............................................135
    14.45 Warning ..........................................137
    14.46 WWW-Authenticate .................................139
   15    ...................................139
    15.1    .................139
    15.2    
    .............................................140
    15.3     
      (Log)...............................141
    15.4   (sensitive)  ....141
    15.5 ,     ............142
    15.6   ...........................143
    15.7  ,   Accept
     ............................................143
    15.8  DNS- (DNS Spoofing).................144
    15.9    Spoofing ................144
   16  ........................................144
   17  ...............................................146
   18   .......................................149
   19  ...........................................150
    19.1    message/http ...................150
    19.2    multipart/byteranges ...........150
    19.3   .............................151
    19.4   HTTP   MIME  ....152
     19.4.1     ............152
     19.4.2    ....................153
     19.4.3  Content-Encoding ......................153
     19.4.4  Content-Transfer-Encoding .............153
     19.4.5  HTTP   Multipart Body-Parts .....153
     19.4.6  Transfer-Encoding .....................154
     19.4.7  MIME ....................................154
    19.5   HTTP/1.0 ..........................154
     19.5.1   -homed  
      IP  .................................155
    19.6   ........................156
     19.6.1    .................156
     19.6.2     .....156
    19.7     ..............160
     19.7.1    ,
      HTTP/1.0  ...............................161







      (HTTP) -   
    , ,   .
   HTTP   World Wide Web (WWW)   1990 . 
    HTTP,   HTTP/0.9,    
       . HTTP/1.0, 
     RFC 1945 [6],    , 
     MIME- ,   
        
   /. , HTTP/1.0   
       - (hierarchical
   proxies), ,  ,  
    (virtual hosts).  ,    
    ,   ,  
    "HTTP/1.0",    , 
       ,  
       .

       "HTTP/1.1".  
      ,  HTTP/1.0, 
     .

        ,
      ,  ,  
     ,   (annotation). HTTP
      ,    .
       ,  
     (URI) [3][20],   (URL) [4]
     (URN),   ,    
   .    ,  
    ,    
     (MIME).

   HTTP        
     -/ (proxies/gateways) 
     ,  ,  SMTP [16], NNTP [13],
   FTP [18], Gopher [2],  WAIS [10].  , HTTP 
     (hypermedia)    
    .




           
      ,   RFC 1123 [8].  
   :

   ,  (MUST)
        ,    
          .

   ,  (SHOULD)
        ,    
        ,     
      .

   ,  (MAY)
        ,    
            ,   -
       .

     ,     
      . ,
        
     ,    ,
          .




          
   ,  ,  HTTP .

    (connection)
         ,   
         .

    (message)
        HTTP ,   
       ,  ,
         4    .

    (request)
       HTTP ,  ,    5.

    (response)
       HTTP ,  ,    5.

    (resource)
          ,   
       URI,    3.2.  
           (  
      ,    ,   , 
        )    
      .

    (entity)
      ,       
      .        
            ,    
      7.

    (representation)
         ,   
       (Content Negotiation),     12.
         ,  
        .

     (content negotiation)
            
       ,     12. 
             ( 
      ).

    (variant)
         ,   , 
          .     
      "".   ""  
      ,     .

    (client)
      ,      
      .

     (user agent)
      ,   .   ,
      ,  (spiders),   
       .

    (server)
      ,   ,   
         .    
        ,   ;   
          ,   ,
        ,   
       . ,     
       , -, ,   (tunnel),
       ,     .

     (origin server)
      ,        
       .

   - (proxy)
      -,     ,  
              .
        -,   ,
        . -  
         ,   .

    (gateway)
      ,      
       .    -,  
            
      ;     ,    
      .

    (tunnel)
      -,   . 
       ,      HTTP ,
       , ,    HTTP.
        ,    
      .

    (cache)
       ,      ,
          ,  ,
         .   , 
        ,      
       ()    .  
          ,     
      ,    .

    (cachable)
        ,     
             
      .     HTTP 
         13.    , 
           
          .

    (first-hand)
        ,   
            ,
           -.  
       ,      
         .

      (explicit expiration time)
      ,      ,
               
        .

      (heuristic expiration time)
       ,  ,    
       .

    (age)
        - ,    , 
          .

     (freshness lifetime)
             .

    (fresh)
        ,       
      .

    (stale)
        ,     
      .

     (semantically transparent)
      ,     " "  
        ,    
          ,    , 
       .    , 
           (  
      (hop-by-hop) ),   , 
        ,   .

?     (validator)
        (,     
       (Last-Modified time)),  , 
      ,       
      .



    HTTP -   /.  
    ,   , URI,  ,
   MIME- ,   , 
   , , ,  ,  . 
     ,    ,
        , MIME- ,
      ,  , ,
   ,  .   HTTP  MIME   
   19.4.

    HTTP     
     ,       
    .    ,   
       (v)  
    (UA)    (O).

               --------------------->
          UA -------------------v------------------- O
             <-----------------------  

      ,    /
       .  
     : -, , 
   . -  -, 
       URI   ,  
      ,     ,
    URI.  -   , 
         () ,  
   ,      .
           
   ;  ,    
     ( Firewall),   
    .

               ----------------------------------->
          UA -----v----- A -----v----- B -----v----- C -----v----- O
             <------------------------------------  

         (A, B,  C) 
       .   
       .   ,
       HTTP    
        ,   
     ,       .
     ,      
     . , B  
      ,     A, / 
     ,   C,    ,  
      .

     ,     , 
        .  
     ,   / , 
          , 
     .   ,  
    ,  B      O
   (  C)  ,      UA,
    A.

               ------->
          UA -----v----- A -----v----- B - - - - - - C - - - - - - O
             <--------  

       ,    
    ,    ,
     .  HTTP    
         13.

   ,      
     -,     
     World Wide Web;    
    -,    
    , ,    
     , ,  
       CD-ROM,   . HTTP 
      -  
    ,     PDA    
    .  HTTP/1.1    
    ,     
    ,     
    web ,   , 
        .

   HTTP     TCP/IP .
       TCP - 80,    
    . HTTP      
     ,   . HTTP 
      ,   
    ,     ;
        HTTP/1.1  
       - ,  
    .

     HTTP/1.0    
     /.  HTTP/1.1, 
          
   /,       
    (  8.1).







    ,   ,    ,
         - (BNF), 
     RFC 822 [9].      
    ,    . 
     -   :

    = 
   name = definition
        -     (  
      "<"  ">"),       "=".
            ,
          , 
         .   , 
       SP, LWS, HT, CRLF, DIGIT, ALPHA  .,  
       .     
       ,      
      .

   ""
   "literal"
         .    ,
        -.

   1 | 2
   rule1 | rule2
      ,   ("|")  . ,
      " | "    ,  .

   (1 2)
   (rule1 rule2)
      ,      
       .  , "(elem (foo | bar) elem)"
         "elem foo elem" 
      "elem bar elem".

   *
   *rule
       "*",  ,  .
        - "<n>*<m>element"   <n>, 
      <m>  .    - 0 
      .    "*(element)" 
         (   );  "1*element"
           ;  "1*2element"
        ,   .

   []
   [rule]
           ; "[foo bar]"
       "*1(foo bar)".

   N 
   N rule
        : "<n>(element)" 
      "<n>*<n>(element)";     <n> 
      .   2DIGIT -   2 ,  3ALPHA
      -     .

   #
   #rule
       "#" ,  "*",  
       .   - "<n>#<m>element" 
       <n>,  <m>  ,  
         (","), , ,  
      (LWS).       ; 
       "( *LWS element *( *LWS "," *LWS element)) " 
        "1#". ,   
      ,   ,    
        .   
      "(element), , (element)" ,     
       .  ,     
       ,        
       .    - 0  .
         "#(element)"   
       (   );  "1#element"  
           ;  "1*2element"
          .

   ; 
   ; comment
        ,     , 
      ,     .  - 
           .

    *LWS
   implied *LWS
      ,      .
        ,    , 
       (LWS)       
       (   ),   
         (tspecials),   
      .       
          (tspecials),    
         .




          
        .
      US-ASCII   ANSI X3.4-1986
   [21].

          OCTET          = < 8-  >

          CHAR           = < US-ASCII  ( 0 - 127)>

          UPALPHA        = < US-ASCII   
                            "A".."Z">

          LOALPHA        = < US-ASCII   
                            "a".."z">

          ALPHA          = UPALPHA | LOALPHA

          DIGIT          = < US-ASCII  "0".."9">

          CTL            = < US-ASCII   (
                           0 - 31)  DEL (127)>

          CR             = <US-ASCII CR,   (13)>

          LF             = <US-ASCII LF,   (10)>

          SP             = <US-ASCII SP,  (32)>

          HT             = <US-ASCII HT,  
                             (9)>

          <">            = <US-ASCII   (34)>

   HTTP/1.1   CR LF    
      ,     (
    19.3    (tolerant applications)).
          
    ,     3.7.

          CRLF           = CR LF

   HTTP/1.1    ,   
         . 
     ,    
   ,    ,   SP.

          LWS            = [CRLF] 1*( SP | HT )

    TEXT      
    ,   ,  
     .  *TEXT  
       (character sets),  
   ISO 8859-1 [22],      
   RFC 1522 [14].

          TEXT           = < OCTET,   CTLs,
                              LWS>

       
   .

          HEX            = "A" | "B" | "C" | "D" | "E" | "F"
                         | "a" | "b" | "c" | "d" | "e" | "f" | DIGIT

       HTTP/1.1   ,
    LWS   .   
        (quoted string),  
       .

          token          = 1*< CHAR   CTLs 
                              tspecials>

          tspecials      = "(" | ")" | "<" | ">" | "@"
                         | "," | ";" | ":" | "\" | <">
                         | "/" | "[" | "]" | "?" | "="
                         | "{" | "}" | SP | HT


      HTTP     .
       . 
      ,  "comment"  
     .      
      .

          comment        = "(" *( ctext | comment ) ")"

          ctext          = < TEXT   "(" and ")">

        ,   ,
     .

          quoted-string  = ( <"> *(qdtext) <"> )

          qdtext         = < TEXT   <">>

       ("\")   
        
       (quoted-string).

          quoted-pair    = "\" CHAR







   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  
       ,     
     .




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




   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 ,    
        -    
       .




   "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).




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

     o  ,     ,   
            URI;

     o         ;

     o         ;

     o   abs_path  "/".

   ,   ,    ""
   ("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







   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.      
          , 
        ..




     HTTP     
       ,    ,
        ,    .

          delta-seconds  = 1*DIGIT




   HTTP       " ",
      MIME:

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

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

     HTTP  ,  
    .       
   IANA [19].

          charset = token

    HTTP      charset
    ,  ,   
        IANA,   
   ,    .  
       , 
      IANA.




        
         . 
          
         
       . ,   
    ,  ,   
   .

          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)
     ;    
     ,   
   ,     , 
          ,
         
     .




        
    ,      
      (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 .




   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].      
    .




         . ,
    ,  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,
       .




   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].




     ,   
         
    .  ,  
       ,  
     ,     .
      ,    
       .

          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.




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

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

   " " -   ,   
        
     .




       : ,
   ,       
     .    . 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. (   
    -   ; , 
    -  ,     
    .)




           
         . 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     .




   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
    ,    ,  
      .







   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     .




     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)].   
           " :
    " (    ) 
          . ,
         ,  
       , , ,
   -        
   .




    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).      , 
       .




      (message-body)   ,
           (
    ):

   1.   ,     
       (message-body) (    
      1xx, 204, 304      HEAD)  
          ,   
        (entity-header fields),  
      .

   2.    Transfer-Encoding ( 14.40)
            
      "chunked",      
      (chunked encoding) ( 3.6).

   3.    Content-Length ( 14.14) ,
            
      (message-body)  .

   4.      "multipart/byteranges",
       ,     .  
         ,    , 
         ;   
       Range     
      (byte-range) ,    
      multipart/byteranges .

   5.     . (
             
      ,          
         ).

      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      
        .




      ,    
    ,     ,   
      .   
       .

          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).




             :
   ,     ,  
      .

           Request       = Request-Line              ;  5.1
                           *( general-header         ;  4.5
                            | request-header         ;  5.3
                            | entity-header )        ;  7.1
                           CRLF
                           [ message-body ]          ;  7.2




     (Request-Line)    , 
     URI (Request-URI),    CRLF.
      SP.    (Request-Line) 
    CR  LF,   
    CRLF.

          Request-Line   = Method SP Request-URI SP HTTP-Version CRLF




      ,     ,
     URI (Request-URI). 
     .

          Method         = "OPTIONS"                ;  9.2
                         | "GET"                    ;  9.3
                         | "HEAD"                   ;  9.4
                         | "POST"                   ;  9.5
                         | "PUT"                    ;  9.6
                         | "DELETE"                 ;  9.7
                         | "TRACE"                  ;  9.8
                         | extension-method

          extension-method = token

    ,   ,     
    Allow ( 14.7).    
     ,       
   ,       
   .      405 (
    , Method Not Allowed),    , 
       ,  501 ( , Not
   Implemented),        .
    ,  ,     
     Public ( 14.35).

    GET  HEAD    
   (general-purpose) .   ; ,
      ,    
   ,    9.




    URI (Request-URI) -   
    (URL,  3.2),    .

          Request-URI    = "*" | absoluteURI | abs_path

       URI (Request-URI)  
    .  "*" ,   
      ,    , 
       ,    
      .
     :

          OPTIONS * HTTP/1.1

   absoluteURI ,    
   -. -     
    ,  ,   . 
   ,  -    
   -   , 
   absoluteURI.     -
         ,  
   ,  ,   IP .
   Request-Line  , , :

          GET http://www.w3.org/pub/WWW/TheProject.html HTTP/1.1

       absoluteURI     
    HTTP,  HTTP/1.1    absoluteURI
    ,  HTTP/1.1      
     -.

      Request-URI - ,   
         .  
      URI (  3.2.1, abs_path)
       Request-URI,    URI
   (net_loc)       Host. 
     ,   
         TCP
     80   "www.w3.org"   :

          GET /pub/WWW/TheProject.html HTTP/1.1
          Host: www.w3.org

      .  ,    
     ;   URI ,   
     "/" (  ).

    -      Request-URI,  
       "*",   - 
       ,   Request-URI
    "*".  

          OPTIONS http://www.ics.uci.edu:8001 HTTP/1.1

      -  

          OPTIONS * HTTP/1.1
          Host: www.ics.uci.edu:8001

       8001  "www.ics.uci.edu".

   Request-URI   ,    3.2.1.
       Request-URI, 
     .    
    Request-URI   .

    ,   , -  
      "abs_path"  URI
   (Request-URI),   ,  , 
    abs_path   "*",   
    -.

      :  "  "
      -    ,
           
       URL   . 
      ,   -HTTP/1.1 -, 
     ,  Request-URI.




    HTTP/1.1   ,  
   ,  - 
     Request-URI,     Host.

    ,      
     (host),    
    Host. (   19.5.1   
     Host  HTTP/1.1).

    ,   ,  
     (    
   vanity hostnames)     
      HTTP/1.1  :

     1.  Request-URI -  absoluteURI,   -  
        Request-URI.     Host  
         .

     2.  Request-URI -  absoluteURI,    
         Host,     
         Host.

     3.  ,   1  2   
        ,      400 (
        , Bad Request).

    HTTP/1.0 ,     
   Host,     (, 
     URI     -  ) 
       .




         
          .  
        , 
        .

          request-header = Accept                   ;  14.1
                         | Accept-Charset           ;  14.2
                         | Accept-Encoding          ;  14.3
                         | Accept-Language          ;  14.4
                         | Authorization            ;  14.8
                         | From                     ;  14.22
                         | Host                     ;  14.23
                         | If-Modified-Since        ;  14.24
                         | If-Match                 ;  14.25
                         | If-None-Match            ;  14.26
                         | If-Range                 ;  14.27
                         | If-Unmodified-Since      ;  14.28
                         | Max-Forwards             ;  14.31
                         | Proxy-Authorization      ;  14.34
                         | Range                    ;  14.36
                         | Referer                  ;  14.37
                         | User-Agent               ;  14.42

       (Request-header)   
          .
   ,       
       (Request-header),  
          
   (Request-header).    
       (entity-header).




        ,  
     HTTP .

       Response      = Status-Line               ;  6.1
                       *( general-header         ;  4.5
                        | response-header        ;  6.2
                        | entity-header )        ;  7.1
                       CRLF
                       [ message-body ]          ;  7.2




      -    (Status-Line). 
       (HTTP-Version),  
    (Status-Code)    (Reason-Phrase),
     SP. CR  LF   
   Status-Line,     CRLF.

       Status-Line = HTTP-Version SP Status-Code SP Reason-Phrase CRLF




      (Status-Code) -  
         .
         10.  
   (Reason-Phrase)     
    .   (Status-Code)  
    ,     
    .      
      (Reason-Phrase).

         .  
         .  5
     :

     o  1xx:   -  , 
             .

     o  2xx:   -    , 
              .

     o  3xx:   -    
                .

     o  4xx:    -    
                 .

     o  5xx:    -     
              .

       ,  
   HTTP/1.1,      
   (Reason-Phrase)  .   (Reason-Phrase),
      ,   
         .

          Status-Code    = "100"   ; , Continue
                         | "101"   ;  ,
                                   ; Switching Protocols
                         | "200"   ; OK
                         | "201"   ; , Created
                         | "202"   ; , Accepted
                         | "203"   ;   ,
                                   ; Non-Authoritative Information
                         | "204"   ;  , No Content
                         | "205"   ;  , Reset
                                   ; Content
                         | "206"   ;  , Partial
                                   ; Content
                         | "300"   ;  , Multiple
                                   ; Choices
                         | "301"   ;  , Moved
                                   ; Permanently
                         | "302"   ;  , Moved
                                   ; Temporarily
                         | "303"   ;  , See Other
                         | "304"   ;  , Not Modified
                         | "305"   ;  -, Use
                                   ; Proxy
                         | "400"   ;  , Bad Request
                         | "401"   ; , Unauthorized
                         | "402"   ;  , Payment
                                   ; Required
                         | "403"   ; , Forbidden
                         | "404"   ;  , Not Found
                         | "405"   ;   , Method Not
                                   ; Allowed
                         | "406"   ;  , Not Acceptable
                         | "407"   ;  
                                   ;   -,
                                   ; Proxy Authentication Required
                         | "408"   ;    ,
                                   ; Request Timeout
                         | "409"   ; , Conflict
                         | "410"   ; , Gone
                         | "411"   ;  , Length Required
                         | "412"   ;  ,
                                   ; Precondition Failed
                         | "413"   ;    ,
                                   ; Request Entity Too Large
                         | "414"   ; URI   ,
                                   ; Request-URI Too Long
                         | "415"   ;   ,
                                   ; Unsupported Media Type
                         | "500"   ;   ,
                                   ; Internal Server Error
                         | "501"   ;  , Not Implemented
                         | "502"   ;  , Bad Gateway
                         | "503"   ;  , Service
                                   ; Unavailable
                         | "504"   ;     ,
                                   ; Gateway Timeout
                         | "505"   ;    HTTP,
                                   ; HTTP Version Not Supported
                         | extension-code

          extension-code = 3DIGIT

          Reason-Phrase  = *<TEXT   CR, LF>

     HTTP . HTTP   
        , 
      . ,  
       ,   
   ,      
      x00  ,   
   ,      .
   ,        
    431,     ,    -
       ,      
    400.      
     ,   ,  
    , ,    
   ,    .




      (response-header fields)  
     ,  , 
          Status-Line.  
            
   ,   Request-URI.

          response-header = Age                     ;  14.6
                          | Location                ;  14.30
                          | Proxy-Authenticate      ;  14.33
                          | Public                  ;  14.35
                          | Retry-After             ;  14.38
                          | Server                  ;  14.39
                          | Vary                    ;  14.43
                          | Warning                 ;  14.45
                          | WWW-Authenticate        ;  14.46

       (Response-header)   
          .
   ,       
       (Response-header),  
          
   (Response-header).    
       (entity-header).

        (Response-header)  
           .
   ,       
           
         . 
         .




         ,   
         . 
        (entity-header)   
   (entity-body),      
     (entity-headers).

        ,    , 
       ,    ,  ,
      .




      (Entity-header fields) 
        ,   
   ,  ,  .

          entity-header  = Allow                    ;  14.7
                         | Content-Base             ;  14.11
                         | Content-Encoding         ;  14.12
                         | Content-Language         ;  14.13
                         | Content-Length           ;  14.14
                         | Content-Location         ;  14.15
                         | Content-MD5              ;  14.16
                         | Content-Range            ;  14.17
                         | Content-Type             ;  14.18
                         | ETag                     ;  14.20
                         | Expires                  ;  14.21
                         | Last-Modified            ;  14.29
                         | extension-header

          extension-header = message-header

        
       (entity-header fields) 
    ,       
   .     
   ,  -   .




     (  )   HTTP 
         ,  
     (entity-header fields).

          entity-body    = *OCTET

     (entity-body)     ,
       (message-body),   
    4.3.   (entity-body)   
    (message-body),   ,
      Transfer-Encoding,    
         
   .




      (entity-body)   ,  
        Content-Type 
   Content-Encoding.    
    :

          entity-body := Content-Encoding( Content-Type( data ) )

     (Content-Type)    
   .   (Content-Encoding) 
        
   ,    (    ).
     (Content-Encoding)  
    .      .

     HTTP/1.1 ,    (entity-body)
       Content-Type,  
     .       ,    
     Content-Type,   
     ,   / 
   ()   URL,    .
       ,  
       "application/octet-stream".




      (entity-body) -    
   (message-body),     
   .  4.4     
    (message-body).








         URL 
    TCP ,     HTTP 
      .  
           
           
   .     
     [30][27];     
     [26].

    HTTP    :

     o       TCP 
             , 
            TCP.

     o  HTTP       
        .     
              , ,
         TCP ,   
         ,   .

     o        ,
          TCP , , , 
         TCP     
         .

     o  HTTP    ;    
           TCP    .
        ,    HTTP  
           ,    
         ,  ,  
            .

   HTTP     .




     HTTP/1.1     HTTP 
    ,       
     HTTP .     
   ,   ,    
   .

      ,  
          TCP . 
        
   Connection.       
          .




   HTTP/1.1   ,  HTTP/1.1   
     ,    
    Connection   
   (connection-token) "close".     
      ,     
   Connection,     (connection-token)
   "close".

   HTTP/1.1   ,    ,
            ,
        Connection  
    "close".  ,     
      ,    
   Connection,    "close".

          
   "close"   Connection,    
    .

        ,   
    HTTP ,   1.1,   
    .   19.7.1    
       HTTP/1.0 .

      ,  ,
         (self-defined)
     ( ,    ),
       4.4.




   ,     
   "  "  ( , 
         ).  
            ,  
     .

   ,      
        ,
       ,   
      .     ,
         ,  ,
     .      
    ,      
     .




    ,  -   
     Connection,    14.2.1.

   -      
         ( 
   -),    .  
         .

   -      
   HTTP/1.0 .




         , 
        . -
        ,  , , 
          .
         
          , 
     .

          ,  
       . 
   ,        
       ,  
   .       
      ,     
     .

   , ,  -   
      . ,    
       ,    
   "" .    , 
   ,       ,    
   ,  .

    ,  , ,  -  
        .
        
          
?     ,   
   idempotent (  9.1.2);     
    ,     
      ,  .

         , 
        .

             
    ,   .    
       ,   
      .

   ,   ,  
     ,     
   .    
    2      -.
   -   2*N   
     -,  N -  
    .    
      HTTP     
      .




    :

   o  HTTP/1.1      
           TCP  
        ,   ,
      ,  ,    
      .      .

   o  HTTP/1.1 (  ) ,  
       (message-body)   
             . 
        ,    
        .     
       " " ("chunked",  3.6),  
       ,      
         .  
        Content-Length,   
      .

   o  HTTP/1.1 (  )     
          100 (, Continue),
        .

   o  HTTP/1.1 (  ) ,    
      HTTP/1.0 (  )     
         100 (, Continue);   
             (  
        ),   
      .

     ,   ,  HTTP/1.1
   (  ) , HTTP/1.1 (  ) 
        100 (, Continue) 
      ,    
   .      ,  
        (TCP),  
        .   
     ,     .

        HTTP,  
        ;  HTTP/1.1  
   HTTP/1.1      ,   
      -    ,
         
?   ,    idempotent (
    9.1.2);      
   ,      
     ,  .    ,
    

     o       ,  

     o        100 (,
        Continue),   ,     .

    HTTP/1.1       HTTP/1.1
     ,    ,   
   HTTP/1.0         
     100 (, Continue).    
         -
        ,    
   .       HTTP/1.0 , 
?       "binary exponential backoff"
   ,       :

   1.     .

   2.    (request-headers).

   3.   R   
           (   
       ),     5 ,
          .

  4.  T = R * (2**N),  N -   
      .

  5.        ,  
      T  (   ).

  6.       ,  T  
      .

  7.   ,    
     ,        1, 
        ,      
     ,          
       .

     ,   HTTP  , 
       ,  

  o     

  o    ,     
     .

   HTTP/1.1 (  ) ,  
           100
   (, Continue),       
   ,   ,      
     100 (, Continue) (   
   ,    ).




       HTTP/1.1  .   
     ,  ,   
     ,    
      .

      Host ( 14.23)  
    HTTP/1.1 .


?9.1   Idempotent .




     ,    
       ,  
        ,  
    ,      
       .

       ,   GET  HEAD 
       ,  .   
     "".    
     ,   POST, PUT  DELETE, 
   ,      ,  
       .

   ,   ,    
         GET; ,
        . 
      ,     
   , , ,    
     .


?9.1.2 Idempotent .

        "idempotence"   ,
       N > 0    , 
      (    
   ).  GET, HEAD, PUT  DELETE  
   .




    OPTIONS      ,
      /, 
    URI (Request-URI).    
     / ,   , 
    ,      
        .

      -     ,   
       ,  ,  
       ( Allow - 
      ,  Content-Type - ). 
       .

     URI (Request-URI) -  ("*"),  
   OPTIONS       .  
      - 200,      
   ,    , 
    (, Public),   , 
     ,    
         (response-header). 
      5.1.2,  "OPTIONS *"   
    -     
    URI (Request-URI)   .

     URI (Request-URI)   ("*"),  
   OPTIONS   ,     
    .     - 200,  
       ,  
    ,     
     (, Allow),   , 
     ,    
         (response-header). 
    OPTIONS   -,  
    ,   ,   
     -.




    GET     (  ),
     URI (Request-URI). 
    URI (Request-URI)   ,
    ,       
     ,     ,
         .

    " GET" ("conditional GET"),  
        If-Modified-Since,
   If-Unmodified-Since, If-Match, If-None-Match,  If-Range.
     GET   ,   
    ,     .
     GET     
   ,       
       ,  
   .

     " GET" ("partial GET"),  
        Range.  GET
       ,    
   14.36.   GET    
    ,      , 
     ,   .

      GET     ,  
     HTTP ,    13.




    HEAD  GET,   ,   
         (message-body).
   ,   HTTP    
   HEAD    ,   
     GET.      
         
     (entity-body).     
         ,
   ,   .

      HEAD      , 
   ,      
        
   .     ,  
        (  , 
   Content-Length, Content-MD5, ETag  Last-Modified),  
       .




    POST   ,    
    ,   ,   
   ,   URI (Request-URI) 
     (Request-Line). POST   , 
       :

     o    ;

     o       
        (bulletin board),    (newsgroup), 
         (mailing list),    ;

     o    ,     ,
         ;

     o       
        (append operation).

    ,   POST, 
         URI (Request-URI).
   ,   POST,    URI  
   ,     ,    ,
        (newsgroup),   
   ,      .

   ,   POST     
    ,      URI. 
    ,    ,    ,
    ,  ,      
    200 (OK),   204 ( , No Content).

         ,  
      201 (, Created)   ,
           ,
      Location (  14.30).

        ,    
      Cache-Control  Expires. ,
       303 ( , See Other) 
        
     .

    POST     ,
      8.2.




      PUT,   ,  
    URI (Request-URI).  Request-URI   
    ,     
     ,   
   .  Request-URI     , 
          
   ,        URI.
      ,     
           
   201 (, Created).    , 
           
      200 (OK),  204 ( , No
   Content).         
    URI (Request-URI),    ,
     .    
     Content-* ( Content-Range),
        ,     
        501 ( , Not
   Implemented).

          URI (Request-URI)
          
   ,        
    .      .

      POST  PUT ,  
      URI (Request-URI). URI  
   POST  ,   
   .     ,  , 
      ,   , 
     (accepts annotations). , URI  
   PUT  ,    - 
      URI  ,   
          .
          URI,  
       301 ( , Moved
   Permanently);      
      .

         
   URI. ,    URI  "
   ",    URI,  
    .   ,  PUT   URI 
    (may result)    URI, 
    .

   HTTP/1.1      PUT  
     .

    PUT     ,
      8.2.




    DELETE     
   ,   URI (Request-URI). 
         ( 
   )   .  
   ,    ,   
   ,      ,
       . ,   
      ,     
          
   .

         200 (OK),  
    ,  ,    
   202 (, Accepted),      ,
       204 ( , No Content), 
       (OK),    .

          URI (Request-URI)
          
   ,       .
        .




    TRACE      
      .    
          
       200 (OK).   
     ,   -,  
   ,    (0)   Max-Forwards 
    (.  14.31).  TRACE   
   .

   TRACE   ,     
           
    .    Via (
   14.44)   ,     
     .    Max-Forwards
        , 
          
   -,  .

      ,     
        (entity-body),  Content-Type
      "message/http".     
    .




     ,  ,   
   ( ),       ,
     .




         ()
   ,      (Status-Line) 
    ,    .  
   HTTP/1.0    1xx  ,  
     1xx  HTTP/1.0 ,  
    .




      .   
   ,  ,   ,  
           . 
         , 
      ,   .  
       ,   
   .




         ,  
           ,
         Upgrade ( 14.41).
       ,    
     Upgrade    ,
         101.

        ,   
   . ,      HTTP 
         ,  
           
    ,    .




       ,    
    , ,  .




      . ,   
     ,   . :

   GET      ,  
         ;

   HEAD       
         (entity-header),   . 
          (message-body) ;

   POST        
          ;

   TRACE    ,   ,
           .




            . 
         URI (  ),
      ;   URL 
        Location.  
          201. 
        ,  
        202 (, Accepted) 
   201.




       ,     .
        ,      ,
          .
           
      .

       202  .  
     ,      
      ( -
   ,       )  
     ,     
       . ,
          
          , 
     ,    
     .




       (entity-header)  -
     ,    ,  ,
          .
         
   ,    ,     
   . ,   
        , 
    .     
      ,    , 
        200 (OK).




     ,     , 
     .   -  ,  
      ,    .
         ,  
      ,     
    .      
      (entity-headers),  
     ,     
   .

       204     , ,
    ,      
    .




     ,     
    ,   .  
       ,    ,
    ,    , 
     , ,    
      .    
   .




      GET  .  
      Range ( 14.36), 
    .      
   Content-Range ( 14.17),  ,  
   ,    (Content-Type)   
   "multipart/byteranges",   Content-Range   
    .  "multipart/byteranges"  , 
    Content-Length    
      (OCTETs),    
   (message-body).

   ,     Range  Content-Range 
         206.




       ,    
       
   .      
       ,   
   ,       GET  HEAD.
        
     5 ,      
    .




       ,  
      .   
           
   ( 12),   ,   (
    )    
        .

        HEAD,    
   ,     ,  
          
   .     ,  
     Content-Type.     
     ,   
      . , 
      -  
    .

         (
   ),     URL  
     Location;     
    Location   .  
    ,    .




         URI,  
         ,   
    URI.     
         URI
   (Request-URI),      ,
       ,   .  
    ,    .

     URI -  ,     URL
     Location.      HEAD,   
        
      ( ) URI.

      301      ,  
   GET  HEAD,     
    ,    ,  
      .

      :    
     POST     301,  
     HTTP/1.0       
     GET.




         URI.  
         ,  
      URI (Request-URI)  
   .       
     Cache-Control  Expires (   , 
     ).

     URI -  ,     URL
     Location.      HEAD,   
        
      ( ) URI.

      302      ,  
   GET  HEAD,     
    ,    ,  
      .

      :    
     POST     302,  
     HTTP/1.0       
     GET.




           URI   
   ,   GET   .  
       ,    
     POST ,  
       .  URI -  
   ,    .   
    303  ,     ()
      .

     URI -  ,     URL
     Location.      HEAD,   
        
      ( ) URI.




       GET ,   , 
     ,    ,  
    .      .

        :

     o  Date

     o  ETag / Content-Location,      
            200    

     o  Expires, Cache-Control, / Vary,   
        (field-value)      
             

     GET     (strong cache
   validator) (  13.3.3),    
      (entity-headers).  ( , 
    GET    (weak validator)), 
        ;  
       
   (entity-bodies)   .

        304  ,  
     ,      
       .

           304 
     ,    
   ,      ,   .

       304     
   (message-body), ,  ,    
      .




         
   -,    Location.   Location 
   URL -. ,    
    -.




      4xx   ,  ,
   ,  .     
   HEAD,    ,  
    ,  ,     
   .        .
        
    .

      :    ,  
     ,  TCP,  ,  
       (),  ,  
       .    
         , TCP  
        (RST) ,  TCP  ,  
     ,     
      ,      
      HTTP.




?         - malformed .
         .




       .  
      WWW-Authenticate ( 14.46),
     (challenge),    .
          
   Authorization ( 14.8).     
     (Authorization credentials)  
   Authorization,      401 ,  
       .  
      401     ,  
    ,      
         ,  
     ,     ,  
?       relevant  .
        HTTP  
    11.




        .




     ,    . 
    (Authorization)  ,     
   .     HEAD    ,
       ,     
    .     ,  
        ,   
      .




      ,   
   URI (Request-URI).       
     .

           ,
           
   403 (, Forbidden).   410 (, Gone)
    ,      
    ,     , 
        .




   ,     (Request-Line)  
     ,   URI
   (Request-URI).     Allow, 
        .




   ,  ,   
      ,   
    (content characteristics),   
     (accept headers),   .

        HEAD,      ,
         
   (locations),       
     .    
   ,     Content-Type.  
        ,  
       . , 
         
   .

      : HTTP/1.1    ,
           (accept
     headers),   .   , 
             
        406.    
        ,  ,
        .   , 
        ,  
            .



           Proxy Authentication Required.

       401 (, Unauthorized), 
   ,       
   (authenticate) -. -  
     Proxy-Authenticate ( 14.33), 
    (challenge),  -  
   .       
    Proxy-Authorization ( 14.34). 
       HTTP    11.




         ,   
   .       .




       -    
   .      ,  ,
           .
         
    ,      . 
   ,       
         ; 
       ,    .

   ,  ,      
   PUT.   ,  ,   
   ,   ,   
       -  (
   ),        409,
    ,      .   ,
           
   ,     Content-Type.




         ,   
      .   
     .   
         
   URI (Request-URI)   .   
   ,    ,    
     ,       
     404 ( , Not Found).   
   ,    .

       410     ,
       WWW,  ,  
         , 
    ,      . 
         , 
      ,  ,  
    .     
      "" ("gone")    
       -    
    .




        
   Content-Length.    ,  
      Content-Length,   
    (message-body)   .




   ,      
    (request-header),     .
           
     (  ) ,  ,
        , 
    ,    .




      ,    
   ,      .  
    ,      
   .

      ,     
    Retry-After   ,   
      .




      ,   
   URI (Request-URI) ,    . 
    , ,   ,  
   ,      POST  
   GET    ,     
   " " URL  (,  URL
       ),    
     ,  
     ,    ,
         
      URI (Request-URI).




      ,    
     ,     
    .




    ,    "5"  , 
     ,      
   .   ,    HEAD, 
     ,    
    ,       .
        
    .       
   .




       ,   
     .




       ,  
    .    , 
            
     .




   ,      -, 
          , 
        .




           -
       .  
   ,      .
      ,    
     Retry-After.  Retry-After   
   ,         
   500.

      :    503 
     ,     , 
     .      .




   ,      -,  
          , 
        .




     ,   ,  HTTP
   ,     . 
   ,        ,
       major ,   ,   
    3.1,   .    ,
   ,     ,   
      .




   HTTP      
   - (challenge-response),   
      (challenge)  ,  
       (authentication
   information).   ,   
        
   (authentication scheme)     
   - (attribute-value),  
   ,     
     .

          auth-scheme    = token

          auth-param     = token "=" quoted-string

       401 (, Unauthorized)
        (challenge)
     (authorization)  .
         WWW-Authenticate,
         (challenge),  
    .

          challenge      = auth-scheme 1*SP realm *( "," auth-param )

          realm          = "realm" "=" realm-value
          realm-value    = quoted-string

     (realm) (   ) 
       ,   
   (challenge).   realm (  ),
        URL (  5.1.2)
   ,    ,   
   (protection space).     
       ,    
      /   
    (authorization database).  realm - ,
       ,  
     ,   
     (authentication scheme).

    ,     
   , ,   ,    
        401  411,  
    Authorization  .   Authorization
      (credentials),  
     (authentication information) 
      (realm)  .

          credentials    = basic-credentials
                         | auth-scheme #auth-param

    (domain),    (credentials) 
      , 
     (protection space).   
     ,    
   (credentials)      
        (protection space)  
   ,    ,
   , /  .  
       ,   
    (protection space)     
    (the scope of its server).

         (credentials),
     ,        401
   (, Unauthorized).    
    WWW-Authenticate,  ( ) 
   (challenge),    ,  ,
    .

    HTTP     
     - (challenge-response) 
     .  
    ,     
        (message encapsulation)
      ,  
    .     
      .

   -      
     .     
    WWW-Authenticate  Authorization  
      14.8.

   HTTP/1.1     
       -  
   Proxy-Authenticate  Proxy-Authorization.



     Scheme).

   ""      , 
          
     (user-ID)   (password) 
     (realm).   (realm)  
    (opaque) ,     
         .  
   ,       
    (user-ID)   (password)   
   (protection space)  URI (Request-URI). 
      .

       URI,    
   (protection space),     (challenge),
    :

          WWW-Authenticate: Basic realm="WallyWorld"

    "WallyWorld" - ,  , 
       URI (Request-URI).

      ,   
    (userid)   (password),  
     (":"),  base64- 
    (credentials).

          basic-credentials = "Basic" SP basic-cookie

          basic-cookie   = <base64- [7] user-pass,
                               76
                             >

          user-pass   = userid ":" password

          userid      = *<TEXT   ":">

          password    = *TEXT

   Userid     .

         
   (userid) "Aladdin",   (password) "open sesame",  
      :

          Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==

     ,     
   ,    15.



     Scheme).

       HTTP  
   RFC 2069 [32].




    HTTP   ,  
   ,    .
       " "
   ,  .     
   ,      ,  
          
    .   , HTTP   
     " " -  
        ,  
    .

      :    " "
     ("format negotiation"),    
         ,   
       ,     ..

    ,    (entity-body)  
    ,   .

       ,    HTTP:
        .  
     , ,  ,  
     .     ,
      , ,  
     ,  ,
      ,  
        .




      ,   
        ,
     .     
    (     ;
    ,   (content-coding),  ..)
          ,
      ,     ( 
     ).

      ,    
         ,
        " " 
       (   
       ,  " "
    ).    ,
          (Accept,
   Accept-Language, Accept-Encoding,  ..),  
    .

       :

     1.     ,     "
        "   ,     
        ,    ,   
          (,  
               ?).

     2.       
             ( , 
             
        )    
        .

     3.       
           .

     4.       
                .

   HTTP/1.1     
   (request-header),    
        
      : Accept ( 14.1),
   Accept-Charset ( 14.2), Accept-Encoding ( 14.3),
   Accept-Language ( 14.4), and User-Agent ( 14.42).
           
   ,     ,  ,
            
     ,     .

     HTTP/1.1   
     Vary ( 14.43)    ,
       .   Vary
    ,      ( 
   ,     
   ""    ).

    HTTP/1.1      Vary, 
      ,   ,  
    13.6,     
     .




      ,   
         
     .     
    ,     (
       Alternates,   
    19.6.2.1)     . 
      URI. 
       ( 
      )    
    ( ) .

      ,    
     (  , , 
   ),      
        , 
          
        .

       ,   
        
   .      , 
    .  ,   
        
   ,        
         HTTP/1.1.

   HTTP/1.1    300 ( ,
   Multiple Choices)  406 ( , Not Acceptable) 
      ,   
         , 
     .




     -     
     .    
      (   
   )      ,
         
          
   .

       ,   
    .    
       ,  
          
    ,     .

         
   ,       
          HTTP/1.1.
   HTTP/1.1 ,     
     Vary ( ,  
   )  ,   ,  
      HTTP/1.1 . 
     ,  
   ,       .


Last-modified: Thu, 03 Dec 1998 18:04:08 GMT
: