home *** CD-ROM | disk | FTP | other *** search
/ Best Tools for JAVA / Best Tools for JAVA.iso / STANDARD / HTTP / HTTP_V1.TXT < prev   
Encoding:
Text File  |  1995-11-09  |  120.7 KB  |  2,734 lines

  1. HTTP Working Group                               T. Berners-Lee, MIT/LCS
  2. INTERNET-DRAFT                                    R. Fielding, UC Irvine
  3. <draft-ietf-http-v10-spec-04.txt>                    H. Frystyk, MIT/LCS
  4. Expires April 14, 1996                                  October 14, 1995
  5.  
  6.  
  7.                 Hypertext Transfer Protocol -- HTTP/1.0
  8.  
  9.  
  10. Status of this Memo
  11.  
  12.    This document is an Internet-Draft. Internet-Drafts are working 
  13.    documents of the Internet Engineering Task Force (IETF), its areas, 
  14.    and its working groups. Note that other groups may also distribute 
  15.    working documents as Internet-Drafts.
  16.  
  17.    Internet-Drafts are draft documents valid for a maximum of six 
  18.    months and may be updated, replaced, or obsoleted by other 
  19.    documents at any time. It is inappropriate to use Internet-Drafts 
  20.    as reference material or to cite them other than as "work in 
  21.    progress".
  22.  
  23.    To learn the current status of any Internet-Draft, please check the 
  24.    "1id-abstracts.txt" listing contained in the Internet-Drafts Shadow 
  25.    Directories on ftp.is.co.za (Africa), nic.nordu.net (Europe), 
  26.    munnari.oz.au (Pacific Rim), ds.internic.net (US East Coast), or 
  27.    ftp.isi.edu (US West Coast).
  28.  
  29.    Distribution of this document is unlimited. Please send comments to 
  30.    the HTTP working group at <http-wg@cuckoo.hpl.hp.com>. Discussions 
  31.    of the working group are archived at 
  32.    <URL:http://www.ics.uci.edu/pub/ietf/http/>. General discussions 
  33.    about HTTP and the applications which use HTTP should take place on 
  34.    the <www-talk@w3.org> mailing list.
  35.  
  36. Abstract
  37.  
  38.    The Hypertext Transfer Protocol (HTTP) is an application-level 
  39.    protocol with the lightness and speed necessary for distributed, 
  40.    collaborative, hypermedia information systems. It is a generic, 
  41.    stateless, object-oriented protocol which can be used for many 
  42.    tasks, such as name servers and distributed object management 
  43.    systems, through extension of its request methods (commands). A 
  44.    feature of HTTP is the typing of data representation, allowing 
  45.    systems to be built independently of the data being transferred.
  46.  
  47.    HTTP has been in use by the World-Wide Web global information 
  48.    initiative since 1990. This specification reflects common usage of 
  49.    the protocol referred to as "HTTP/1.0".
  50.  
  51. Table of Contents
  52.  
  53.    1.  Introduction
  54.        1.1  Purpose
  55.        1.2  Terminology
  56.        1.3  Overall Operation
  57.  
  58.    2.  Notational Conventions and Generic Grammar
  59.        2.1  Augmented BNF
  60.        2.2  Basic Rules
  61.  
  62.    3.  Protocol Parameters
  63.        3.1  HTTP Version
  64.        3.2  Uniform Resource Identifiers
  65.             3.2.1  General Syntax
  66.             3.2.2  http URL
  67.        3.3  Date/Time Formats
  68.        3.4  Character Sets
  69.        3.5  Content Codings
  70.        3.6  Media Types
  71.             3.6.1  Canonicalization and Text Defaults
  72.             3.6.2  Multipart Types
  73.        3.7  Product Tokens
  74.  
  75.    4.  HTTP Message
  76.        4.1  Message Types
  77.        4.2  Message Headers
  78.        4.3  General Header Fields
  79.  
  80.    5.  Request
  81.        5.1  Request-Line
  82.             5.1.1  Method
  83.             5.1.2  Request-URI
  84.        5.2  Request Header Fields
  85.  
  86.    6.  Response
  87.        6.1  Status-Line
  88.             6.1.1  Status Code and Reason Phrase
  89.        6.2  Response Header Fields
  90.  
  91.    7.  Entity
  92.        7.1  Entity Header Fields
  93.        7.2  Entity Body
  94.             7.2.1  Type
  95.             7.2.2  Length
  96.  
  97.    8.  Method Definitions
  98.        8.1  GET
  99.        8.2  HEAD
  100.        8.3  POST
  101.  
  102.    9.  Status Code Definitions
  103.        9.1  Informational 1xx
  104.        9.2  Successful 2xx
  105.        9.3  Redirection 3xx
  106.        9.4  Client Error 4xx
  107.        9.5  Server Error 5xx
  108.  
  109.    10. Header Field Definitions
  110.        10.1  Allow
  111.        10.2  Authorization
  112.        10.3  Content-Encoding
  113.        10.4  Content-Length
  114.        10.5  Content-Type
  115.        10.6  Date
  116.        10.7  Expires
  117.        10.8  From
  118.        10.9  If-Modified-Since
  119.        10.10 Last-Modified
  120.        10.11 Location
  121.        10.12 MIME-Version
  122.        10.13 Pragma
  123.        10.14 Referer
  124.        10.15 Server
  125.        10.16 User-Agent
  126.        10.17 WWW-Authenticate
  127.  
  128.    11. Access Authentication
  129.        11.1  Basic Authentication Scheme
  130.  
  131.    12. Security Considerations
  132.        12.1  Authentication of Clients
  133.        12.2  Safe Methods
  134.        12.3  Abuse of Server Log Information
  135.        12.4  Transfer of Sensitive Information
  136.  
  137.    13. Acknowledgments
  138.  
  139.    14. References
  140.  
  141.    15. Authors' Addresses
  142.  
  143.    Appendix A.   Internet Media Type message/http
  144.  
  145.    Appendix B.   Tolerant Applications
  146.  
  147.    Appendix C.   Relationship to MIME
  148.        C.1  Conversion to Canonical Form
  149.             C.1.1  Representation of Line Breaks
  150.             C.1.2  Default Character Set
  151.        C.2  Conversion of Date Formats
  152.        C.3  Introduction of Content-Encoding
  153.        C.4  No Content-Transfer-Encoding
  154.  
  155.  
  156.  
  157. 1.  Introduction
  158.  
  159. 1.1  Purpose
  160.  
  161.    The Hypertext Transfer Protocol (HTTP) is an application-level 
  162.    protocol with the lightness and speed necessary for distributed, 
  163.    collaborative, hypermedia information systems. HTTP has been in use 
  164.    by the World-Wide Web global information initiative since 1990. 
  165.    This specification reflects common usage of the protocol referred 
  166.    to as "HTTP/1.0". This specification is not intended to become an 
  167.    Internet standard; rather, it defines those features of the HTTP 
  168.    protocol that can reasonably be expected of any implementation 
  169.    which claims to be using HTTP/1.0.
  170.  
  171.    Practical information systems require more functionality than 
  172.    simple retrieval, including search, front-end update, and 
  173.    annotation. HTTP allows an open-ended set of methods to be used to 
  174.    indicate the purpose of a request. It builds on the discipline of 
  175.    reference provided by the Uniform Resource Identifier (URI) [2], as 
  176.    a location (URL) [4] or name (URN) [16], for indicating the 
  177.    resource on which a method is to be applied. Messages are passed in 
  178.    a format similar to that used by Internet Mail [7] and the 
  179.    Multipurpose Internet Mail Extensions (MIME) [5].
  180.  
  181.    HTTP is also used as a generic protocol for communication between 
  182.    user agents and proxies/gateways to other Internet protocols, such 
  183.    as SMTP [12], NNTP [11], FTP [14], Gopher [1], and WAIS [8], 
  184.    allowing basic hypermedia access to resources available from 
  185.    diverse applications and simplifying the implementation of user 
  186.    agents.
  187.  
  188. 1.2  Terminology
  189.  
  190.    This specification uses a number of terms to refer to the roles 
  191.    played by participants in, and objects of, the HTTP communication.
  192.  
  193.    connection
  194.  
  195.        A transport layer virtual circuit established between two 
  196.        application programs for the purpose of communication.
  197.  
  198.    message
  199.  
  200.        The basic unit of HTTP communication, consisting of a structured 
  201.        sequence of octets matching the syntax defined in Section 4 and 
  202.        transmitted via the connection.
  203.  
  204.    request
  205.  
  206.        An HTTP request message (as defined in Section 5).
  207.  
  208.    response
  209.  
  210.        An HTTP response message (as defined in Section 6).
  211.  
  212.    resource
  213.  
  214.        A network data object or service which can be identified by a 
  215.        URI (Section 3.2).
  216.  
  217.    entity
  218.  
  219.        A particular representation or rendition of a data resource, or 
  220.        reply from a service resource, that may be enclosed within a 
  221.        request or response message. An entity consists of 
  222.        metainformation in the form of entity headers and content in the 
  223.        form of an entity body.
  224.  
  225.    client
  226.  
  227.        An application program that establishes connections for the 
  228.        purpose of sending requests.
  229.  
  230.    user agent
  231.  
  232.        The client which initiates a request. These are often browsers, 
  233.        editors, spiders (web-traversing robots), or other end user 
  234.        tools.
  235.  
  236.    server
  237.  
  238.        An application program that accepts connections in order to 
  239.        service requests by sending back responses.
  240.  
  241.    origin server
  242.  
  243.        The server on which a given resource resides or is to be created.
  244.  
  245.    proxy
  246.  
  247.        An intermediary program which acts as both a server and a client 
  248.        for the purpose of making requests on behalf of other clients. 
  249.        Requests are serviced internally or by passing them, with 
  250.        possible translation, on to other servers. A proxy must 
  251.        interpret and, if necessary, rewrite a request message before 
  252.        forwarding it. Proxies are often used as client-side portals 
  253.        through network firewalls and as helper applications for 
  254.        handling requests via protocols not implemented by the user 
  255.        agent.
  256.  
  257.    gateway
  258.  
  259.        A server which acts as an intermediary for some other server. 
  260.        Unlike a proxy, a gateway receives requests as if it were the 
  261.        origin server for the requested resource; the requesting client 
  262.        may not be aware that it is communicating with a gateway. 
  263.        Gateways are often used as server-side portals through network 
  264.        firewalls and as protocol translators for access to resources 
  265.        stored on non-HTTP systems.
  266.  
  267.    tunnel
  268.  
  269.        A tunnel is an intermediary program which is acting as a blind 
  270.        relay between two connections. Once active, a tunnel is not 
  271.        considered a party to the HTTP communication, though the tunnel 
  272.        may have been initiated by an HTTP request. A tunnel is closed 
  273.        when both ends of the relayed connections are closed. Tunnels 
  274.        are used when a portal is necessary and the intermediary cannot, 
  275.        or should not, interpret the relayed communication.
  276.  
  277.    cache
  278.  
  279.        A program's local store of response messages and the subsystem 
  280.        that controls its message storage, retrieval, and deletion. A 
  281.        cache stores cachable responses in order to reduce the response 
  282.        time and network bandwidth consumption on future, equivalent 
  283.        requests. Any client or server may include a cache, though a 
  284.        cache cannot be used by a server while it is acting as a tunnel.
  285.  
  286.    Any given program may be capable of being both a client and a 
  287.    server; our use of these terms refers only to the role being 
  288.    performed by the program for a particular connection, rather than 
  289.    to the program's capabilities in general. Likewise, any server may 
  290.    act as an origin server, proxy, gateway, or tunnel, switching 
  291.    behavior based on the nature of each request.
  292.  
  293. 1.3  Overall Operation
  294.  
  295.    The HTTP protocol is based on a request/response paradigm. A client 
  296.    establishes a connection with a server and sends a request to the 
  297.    server in the form of a request method, URI, and protocol version, 
  298.    followed by a MIME-like message containing request modifiers, 
  299.    client information, and possible body content. The server responds 
  300.    with a status line, including the message's protocol version and a 
  301.    success or error code, followed by a MIME-like message containing 
  302.    server information, entity metainformation, and possible body 
  303.    content.
  304.  
  305.    Most HTTP communication is initiated by a user agent and consists 
  306.    of a request to be applied to a resource on some origin server. In 
  307.    the simplest case, this may be accomplished via a single connection 
  308.    (v) between the user agent (UA) and the origin server (O).
  309.  
  310.           request chain ------------------------>
  311.        UA -------------------v------------------- O
  312.           <----------------------- response chain
  313.  
  314.    A more complicated situation occurs when one or more intermediaries 
  315.    are present in the request/response chain. There are three common 
  316.    forms of intermediary: proxy, gateway, and tunnel. A proxy is a 
  317.    forwarding agent, receiving requests for a URI in its absolute 
  318.    form, rewriting all or parts of the message, and forwarding the 
  319.    reformatted request toward the server identified by the URI. A 
  320.    gateway is a receiving agent, acting as a layer above some other 
  321.    server(s) and, if necessary, translating the requests to the 
  322.    underlying server's protocol. A tunnel acts as a relay point 
  323.    between two connections without changing the messages; tunnels are 
  324.    used when the communication needs to pass through an intermediary 
  325.    (such as a firewall) even when the intermediary cannot understand 
  326.    the contents of the messages.
  327.  
  328.           request chain -------------------------------------->
  329.        UA -----v----- A -----v----- B -----v----- C -----v----- O
  330.           <------------------------------------- response chain
  331.  
  332.    The figure above shows three intermediaries (A, B, and C) between 
  333.    the user agent and origin server. A request or response message 
  334.    that travels the whole chain must pass through four separate 
  335.    connections. This distinction is important because some HTTP 
  336.    communication options may apply only to the connection with the 
  337.    nearest, non-tunnel neighbor, only to the end-points of the chain, 
  338.    or to all connections along the chain. Although the diagram is 
  339.    linear, each participant may be engaged in multiple, simultaneous 
  340.    communications. For example, B may be receiving requests from many 
  341.    clients other than A, and/or forwarding requests to servers other 
  342.    than C, at the same time that it is handling A's request.
  343.  
  344.    Any party to the communication which is not acting as a tunnel may 
  345.    employ an internal cache for handling requests. The effect of a 
  346.    cache is that the request/response chain is shortened if one of the 
  347.    participants along the chain has a cached response applicable to 
  348.    that request. The following illustrates the resulting chain if B 
  349.    has a cached copy of an earlier response from O (via C) for a 
  350.    request which has not been cached by UA or A.
  351.  
  352.           request chain ---------->
  353.        UA -----v----- A -----v----- B - - - - - - C - - - - - - O
  354.           <--------- response chain
  355.  
  356.    Not all responses are cachable, and some requests may contain 
  357.    modifiers which place special requirements on cache behavior. 
  358.    Historically, HTTP/1.0 applications have not adequately defined 
  359.    what is or is not a "cachable" response.
  360.  
  361.    On the Internet, HTTP communication generally takes place over 
  362.    TCP/IP connections. The default port is TCP 80 [15], but other 
  363.    ports can be used. This does not preclude HTTP from being 
  364.    implemented on top of any other protocol on the Internet, or on 
  365.    other networks. HTTP only presumes a reliable transport; any 
  366.    protocol that provides such guarantees can be used, and the mapping 
  367.    of the HTTP/1.0 request and response structures onto the transport 
  368.    data units of the protocol in question is outside the scope of this 
  369.    specification.
  370.  
  371.    Current practice requires that the connection be established by the 
  372.    client prior to each request and closed by the server after sending 
  373.    the response. Both clients and servers must be capable of handling 
  374.    cases where either party closes the connection prematurely, due to 
  375.    user action, automated time-out, or program failure. In any case, 
  376.    the closing of the connection by either or both parties always 
  377.    terminates the current request, regardless of its status.
  378.  
  379. 2.  Notational Conventions and Generic Grammar
  380.  
  381. 2.1  Augmented BNF
  382.  
  383.    All of the mechanisms specified in this document are described in 
  384.    both prose and an augmented Backus-Naur Form (BNF) similar to that 
  385.    used by RFC 822 [7]. Implementors will need to be familiar with the 
  386.    notation in order to understand this specification. The augmented 
  387.    BNF includes the following constructs:
  388.  
  389.    name = definition
  390.  
  391.        The name of a rule is simply the name itself (without any 
  392.        enclosing "<" and ">") and is separated from its definition by 
  393.        the equal character "=". Whitespace is only significant in that 
  394.        indentation of continuation lines is used to indicate a rule 
  395.        definition that spans more than one line. Certain basic rules 
  396.        are in uppercase, such as SP, LWS, HT, CRLF, DIGIT, ALPHA, etc. 
  397.        Angle brackets are used within definitions whenever their 
  398.        presence will facilitate discerning the use of rule names.
  399.  
  400.    "literal"
  401.  
  402.        Quotation marks surround literal text. Unless stated otherwise, 
  403.        the text is case-insensitive.
  404.  
  405.    rule1 | rule2
  406.  
  407.        Elements separated by a bar ("I") are alternatives,
  408.        e.g., "yes | no" will accept yes or no.
  409.  
  410.    (rule1 rule2)
  411.  
  412.        Elements enclosed in parentheses are treated as a single 
  413.        element. Thus, "(elem (foo | bar) elem)" allows the token 
  414.        sequences "elem foo elem" and "elem bar elem".
  415.  
  416.    *rule
  417.  
  418.        The character "*" preceding an element indicates repetition. The 
  419.        full form is "<n>*<m>element" indicating at least <n> and at 
  420.        most <m> occurrences of element. Default values are 0 and 
  421.        infinity so that "*(element)" allows any number, including zero; 
  422.        "1*element" requires at least one; and "1*2element" allows one 
  423.        or two.
  424.  
  425.    [rule]
  426.  
  427.        Square brackets enclose optional elements; "[foo bar]" is 
  428.        equivalent to "*1(foo bar)".
  429.  
  430.    N rule
  431.  
  432.        Specific repetition: "<n>(element)" is equivalent to 
  433.        "<n>*<n>(element)"; that is, exactly <n> occurrences of 
  434.        (element). Thus 2DIGIT is a 2-digit number, and 3ALPHA is a 
  435.        string of three alphabetic characters.
  436.  
  437.    #rule
  438.  
  439.        A construct "#" is defined, similar to "*", for defining lists 
  440.        of elements. The full form is "<n>#<m>element" indicating at 
  441.        least <n> and at most <m> elements, each separated by one or 
  442.        more commas (",") and optional linear whitespace (LWS). This 
  443.        makes the usual form of lists very easy; a rule such as 
  444.        "( *LWS element *( *LWS "," *LWS element ))" can be shown as 
  445.        "1#element". Wherever this construct is used, null elements are 
  446.        allowed, but do not contribute to the count of elements present. 
  447.        That is, "(element), , (element)" is permitted, but counts as 
  448.        only two elements. Therefore, where at least one element is 
  449.        required, at least one non-null element must be present. Default 
  450.        values are 0 and infinity so that "#(element)" allows any 
  451.        number, including zero; "1#element" requires at least one; and 
  452.        "1#2element" allows one or two.
  453.  
  454.    ; comment
  455.  
  456.        A semi-colon, set off some distance to the right of rule text, 
  457.        starts a comment that continues to the end of line. This is a 
  458.        simple way of including useful notes in parallel with the 
  459.        specifications.
  460.  
  461.    implied *LWS
  462.  
  463.        The grammar described by this specification is word-based. 
  464.        Except where noted otherwise, linear whitespace (LWS) can be 
  465.        included between any two adjacent words (token or 
  466.        quoted-string), and between adjacent tokens and delimiters 
  467.        (tspecials), without changing the interpretation of a field. 
  468.        However, applications should attempt to follow "common form" 
  469.        when generating HTTP constructs, since there exist some 
  470.        implementations that fail to accept anything beyond the common 
  471.        forms.
  472.  
  473. 2.2  Basic Rules
  474.  
  475.    The following rules are used throughout this specification to 
  476.    describe basic parsing constructs. The US-ASCII coded character set 
  477.    is defined by [17].
  478.  
  479.        OCTET          = <any 8-bit sequence of data>
  480.        CHAR           = <any US-ASCII character (octets 0 - 127)>
  481.        UPALPHA        = <any US-ASCII uppercase letter "A".."Z">
  482.        LOALPHA        = <any US-ASCII lowercase letter "a".."z">
  483.        ALPHA          = UPALPHA | LOALPHA
  484.        DIGIT          = <any US-ASCII digit "0".."9">
  485.        CTL            = <any US-ASCII control character
  486.                         (octets 0 - 31) and DEL (127)>
  487.        CR             = <US-ASCII CR, carriage return (13)>
  488.        LF             = <US-ASCII LF, linefeed (10)>
  489.        SP             = <US-ASCII SP, space (32)>
  490.        HT             = <US-ASCII HT, horizontal-tab (9)>
  491.        <">            = <US-ASCII double-quote mark (34)>
  492.  
  493.    HTTP/1.0 defines the octet sequence CR LF as the end-of-line marker 
  494.    for all protocol elements except the Entity-Body (see Appendix B 
  495.    for tolerant applications). The end-of-line marker within an 
  496.    Entity-Body is defined by its associated media type, as described 
  497.    in Section 3.6.
  498.  
  499.        CRLF           = CR LF
  500.  
  501.    HTTP/1.0 headers may be folded onto multiple lines if each 
  502.    continuation line begins with a space or horizontal tab. All linear 
  503.    whitespace, including folding, has the same semantics as SP.
  504.  
  505.        LWS            = [CRLF] 1*( SP | HT )
  506.  
  507.    However, folding of header lines is not expected by some 
  508.    applications, and should not be generated by HTTP/1.0 applications.
  509.  
  510.    The TEXT rule is only used for descriptive field contents and 
  511.    values that are not intended to be interpreted by the message 
  512.    parser. Words of *TEXT may contain octets from character sets other 
  513.    than US-ASCII.
  514.  
  515.        TEXT           = <any OCTET except CTLs,
  516.                         but including LWS>
  517.  
  518.    Recipients of header field TEXT containing octets outside the 
  519.    US-ASCII character set may assume that they represent ISO-8859-1 
  520.    characters.
  521.  
  522.    Many HTTP/1.0 header field values consist of words separated by LWS 
  523.    or special characters. These special characters must be in a quoted 
  524.    string to be used within a parameter value.
  525.  
  526.        word           = token | quoted-string
  527.  
  528.        token          = 1*<any CHAR except CTLs or tspecials>
  529.  
  530.        tspecials      = "(" | ")" | "<" | ">" | "@"
  531.                       | "," | ";" | ":" | "\" | <">
  532.                       | "/" | "[" | "]" | "?" | "="
  533.                       | "{" | "}" | SP | HT
  534.  
  535.    Comments may be included in some HTTP header fields by surrounding 
  536.    the comment text with parentheses. Comments are only allowed in 
  537.    fields containing "comment" as part of their field value definition.
  538.  
  539.        comment        = "(" *( ctext | comment ) ")"
  540.        ctext          = <any TEXT excluding "(" and ")">
  541.  
  542.    A string of text is parsed as a single word if it is quoted using 
  543.    double-quote marks.
  544.  
  545.        quoted-string  = ( <"> *(qdtext) <"> )
  546.  
  547.        qdtext         = <any CHAR except <"> and CTLs,
  548.                         but including LWS>
  549.  
  550.    Single-character quoting using the backslash ("\") character is not 
  551.    permitted in HTTP/1.0.
  552.  
  553. 3.  Protocol Parameters
  554.  
  555. 3.1  HTTP Version
  556.  
  557.    HTTP uses a "<major>.<minor>" numbering scheme to indicate versions 
  558.    of the protocol. The protocol versioning policy is intended to 
  559.    allow the sender to indicate the format of a message and its 
  560.    capacity for understanding further HTTP communication, rather than 
  561.    the features obtained via that communication. No change is made to 
  562.    the version number for the addition of message components which do 
  563.    not affect communication behavior or which only add to extensible 
  564.    field values. The <minor> number is incremented when the changes 
  565.    made to the protocol add features which do not change the general 
  566.    message parsing algorithm, but which may add to the message 
  567.    semantics and imply additional capabilities of the sender. The 
  568.    <major> number is incremented when the format of a message within 
  569.    the protocol is changed.
  570.  
  571.    The version of an HTTP message is indicated by an HTTP-Version 
  572.    field in the first line of the message. If the protocol version is 
  573.    not specified, the recipient must assume that the message is in the 
  574.    simple HTTP/0.9 format.
  575.  
  576.        HTTP-Version   = "HTTP" "/" 1*DIGIT "." 1*DIGIT
  577.  
  578.    Note that the major and minor numbers should be treated as separate 
  579.    integers and that each may be incremented higher than a single 
  580.    digit. Thus, HTTP/2.4 is a lower version than HTTP/2.13, which in 
  581.    turn is lower than HTTP/12.3. Leading zeros should be ignored by 
  582.    recipients and never generated by senders.
  583.  
  584.    This document defines both the 0.9 and 1.0 versions of the HTTP 
  585.    protocol. Applications sending Full-Request or Full-Response 
  586.    messages, as defined by this specification, must include an 
  587.    HTTP-Version of "HTTP/1.0".
  588.  
  589.    HTTP/1.0 servers must:
  590.  
  591.       o recognize the format of the Request-Line for HTTP/0.9 and 
  592.         HTTP/1.0 requests;
  593.  
  594.       o understand any valid request in the format of HTTP/0.9 or 
  595.         HTTP/1.0;
  596.  
  597.       o respond appropriately with a message in the same protocol 
  598.         version used by the client.
  599.  
  600.    HTTP/1.0 clients must:
  601.  
  602.       o recognize the format of the Status-Line for HTTP/1.0 responses;
  603.  
  604.       o understand any valid response in the format of HTTP/0.9 or 
  605.         HTTP/1.0.
  606.  
  607.    Proxy and gateway applications must be careful in forwarding 
  608.    requests that are received in a format different than that of the 
  609.    application's native HTTP version. Since the protocol version 
  610.    indicates the protocol capability of the sender, a proxy/gateway 
  611.    must never send a message with a version indicator which is greater 
  612.    than its native version; if a higher version request is received, 
  613.    the proxy/gateway must either downgrade the request version or 
  614.    respond with an error. Requests with a version lower than that of 
  615.    the application's native format may be upgraded before being 
  616.    forwarded; the proxy/gateway's response to that request must follow 
  617.    the normal server requirements.
  618.  
  619. 3.2  Uniform Resource Identifiers
  620.  
  621.    URIs have been known by many names: WWW addresses, Universal 
  622.    Document Identifiers, Universal Resource Identifiers [2], and 
  623.    finally the combination of Uniform Resource Locators (URL) [4] and 
  624.    Names (URN) [16]. As far as HTTP is concerned, Uniform Resource 
  625.    Identifiers are simply formatted strings which identify--via name, 
  626.    location, or any other characteristic--a network resource.
  627.  
  628. 3.2.1 General Syntax
  629.  
  630.    URIs in HTTP/1.0 can be represented in absolute form or relative to 
  631.    some known base URI [9], depending upon the context of their use. 
  632.    The two forms are differentiated by the fact that absolute URIs 
  633.    always begin with a scheme name followed by a colon.
  634.  
  635.        URI            = ( absoluteURI | relativeURI ) [ "#" fragment ]
  636.  
  637.        absoluteURI    = scheme ":" *( uchar | reserved )
  638.  
  639.        relativeURI    = net_path | abs_path | rel_path
  640.  
  641.        net_path       = "//" net_loc [ abs_path ]
  642.        abs_path       = "/" rel_path
  643.        rel_path       = [ path ] [ ";" params ] [ "?" query ]
  644.  
  645.        path           = fsegment *( "/" segment )
  646.        fsegment       = 1*pchar
  647.        segment        = *pchar
  648.  
  649.        params         = param *( ";" param )
  650.        param          = *( pchar | "/" )
  651.  
  652.        scheme         = 1*( ALPHA | DIGIT | "+" | "-" | "." )
  653.        net_loc        = *( pchar | ";" | "?" )
  654.        query          = *( uchar | reserved )
  655.        fragment       = *( uchar | reserved )
  656.  
  657.        pchar          = uchar | ":" | "@" | "&" | "="
  658.        uchar          = unreserved | escape
  659.        unreserved     = ALPHA | DIGIT | safe | extra | national
  660.  
  661.        escape         = "%" hex hex
  662.        hex            = "A" | "B" | "C" | "D" | "E" | "F"
  663.                       | "a" | "b" | "c" | "d" | "e" | "f" | DIGIT
  664.  
  665.        reserved       = ";" | "/" | "?" | ":" | "@" | "&" | "="
  666.        safe           = "$" | "-" | "_" | "." | "+"
  667.        extra          = "!" | "*" | "'" | "(" | ")" | ","
  668.        national       = <any OCTET excluding CTLs, SP,
  669.                          ALPHA, DIGIT, reserved, safe, and extra>
  670.  
  671.    For definitive information on URL syntax and semantics, see RFC 
  672.    1738 [4] and RFC 1808 [9]. The BNF above includes national 
  673.    characters not allowed in valid URLs as specified by RFC 1738, 
  674.    since HTTP servers are not restricted in the set of unreserved 
  675.    characters allowed to represent the rel_path part of addresses, and 
  676.    HTTP proxies may receive requests for URIs not defined by RFC 1738.
  677.  
  678. 3.2.2 http URL
  679.  
  680.    The "http" scheme is used to locate network resources via the HTTP 
  681.    protocol. This section defines the scheme-specific syntax and 
  682.    semantics for http URLs.
  683.  
  684.        http_URL       = "http:" "//" host [ ":" port ] abs_path
  685.  
  686.        host           = <A legal Internet host domain name
  687.                          or IP address (in dotted-decimal form),
  688.                          as defined by Section 2.1 of RFC 1123>
  689.  
  690.        port           = *DIGIT
  691.  
  692.    If the port is empty or not given, port 80 is assumed. The 
  693.    semantics are that the identified resource is located at the server 
  694.    listening for TCP connections on that port of that host, and the 
  695.    Request-URI for the resource is abs_path. If the abs_path is not 
  696.    present in the URL, it must be given as "/" when used as a 
  697.    Request-URI.
  698.  
  699.        Note: Although the HTTP protocol is independent of the 
  700.        transport layer protocol, the http URL only identifies 
  701.        resources by their TCP location, and thus non-TCP resources 
  702.        must be identified by some other URI scheme.
  703.  
  704.    The canonical form for "http" URLs is obtained by converting any 
  705.    UPALPHA characters in host to their LOALPHA equivalent (hostnames 
  706.    are case-insensitive), eliding the [ ":" port ] if the port is 80, 
  707.    and replacing an empty abs_path with "/".
  708.  
  709. 3.3  Date/Time Formats
  710.  
  711.    HTTP/1.0 applications have historically allowed three different 
  712.    formats for the representation of date/time stamps:
  713.  
  714.        Sun, 06 Nov 1994 08:49:37 GMT    ; RFC 822, updated by RFC 1123
  715.        Sunday, 06-Nov-94 08:49:37 GMT   ; RFC 850, obsoleted by RFC 1036
  716.        Sun Nov  6 08:49:37 1994         ; ANSI C's asctime() format
  717.  
  718.    The first format is preferred as an Internet standard and 
  719.    represents a fixed-length subset of that defined by RFC 1123 [6] 
  720.    (an update to RFC 822 [7]). The second format is in common use, but 
  721.    is based on the obsolete RFC 850 [10] date format and lacks a 
  722.    four-digit year. HTTP/1.0 clients and servers that parse the date 
  723.    value should accept all three formats, though they must never 
  724.    generate the third (asctime) format.
  725.  
  726.        Note: Recipients of date values are encouraged to be robust 
  727.        in accepting date values that may have been generated by 
  728.        non-HTTP applications, as is sometimes the case when 
  729.        retrieving or posting messages via proxies/gateways to SMTP 
  730.        or NNTP.
  731.  
  732.    All HTTP/1.0 date/time stamps must be represented in Universal Time 
  733.    (UT), also known as Greenwich Mean Time (GMT), without exception. 
  734.    This is indicated in the first two formats by the inclusion of 
  735.    "GMT" as the three-letter abbreviation for time zone, and should be 
  736.    assumed when reading the asctime format.
  737.  
  738.        HTTP-date      = rfc1123-date | rfc850-date | asctime-date
  739.  
  740.        rfc1123-date   = wkday "," SP date1 SP time SP "GMT"
  741.        rfc850-date    = weekday "," SP date2 SP time SP "GMT"
  742.        asctime-date   = wkday SP date3 SP time SP 4DIGIT
  743.  
  744.        date1          = 2DIGIT SP month SP 4DIGIT
  745.                         ; day month year (e.g., 02 Jun 1982)
  746.        date2          = 2DIGIT "-" month "-" 2DIGIT
  747.                         ; day-month-year (e.g., 02-Jun-82)
  748.        date3          = month SP ( 2DIGIT | ( SP 1DIGIT ))
  749.                         ; month day (e.g., Jun  2)
  750.  
  751.        time           = 2DIGIT ":" 2DIGIT ":" 2DIGIT
  752.                         ; 00:00:00 - 23:59:59
  753.  
  754.        wkday          = "Mon" | "Tue" | "Wed"
  755.                       | "Thu" | "Fri" | "Sat" | "Sun"
  756.  
  757.        weekday        = "Monday" | "Tuesday" | "Wednesday"
  758.                       | "Thursday" | "Friday" | "Saturday" | "Sunday"
  759.  
  760.        month          = "Jan" | "Feb" | "Mar" | "Apr"
  761.                       | "May" | "Jun" | "Jul" | "Aug"
  762.                       | "Sep" | "Oct" | "Nov" | "Dec"
  763.  
  764.        Note: HTTP/1.0 requirements for the date/time stamp format 
  765.        apply only to their usage within the protocol stream. 
  766.        Clients and servers are not required to use these formats 
  767.        for user presentation, request logging, etc.
  768.  
  769. 3.4  Character Sets
  770.  
  771.    HTTP uses the same definition of the term "character set" as that 
  772.    described for MIME:
  773.  
  774.         The term "character set" is used in this document to 
  775.         refer to a method used with one or more tables to convert 
  776.         a sequence of octets into a sequence of characters. Note 
  777.         that unconditional conversion in the other direction is 
  778.         not required, in that not all characters may be available 
  779.         in a given character set and a character set may provide 
  780.         more than one sequence of octets to represent a 
  781.         particular character. This definition is intended to 
  782.         allow various kinds of character encodings, from simple 
  783.         single-table mappings such as US-ASCII to complex table 
  784.         switching methods such as those that use ISO 2022's 
  785.         techniques. However, the definition associated with a 
  786.         MIME character set name must fully specify the mapping to 
  787.         be performed from octets to characters. In particular, 
  788.         use of external profiling information to determine the 
  789.         exact mapping is not permitted.
  790.  
  791.    HTTP character sets are identified by case-insensitive tokens. The 
  792.    complete set of tokens are defined by the IANA Character Set 
  793.    registry [15]. However, because that registry does not define a 
  794.    single, consistent token for each character set, we define here the 
  795.    preferred names for those character sets most likely to be used 
  796.    with HTTP entities. These character sets include those registered 
  797.    by RFC 1521 [5] -- the US-ASCII [17] and ISO-8859 [18] character 
  798.    sets -- and other names specifically recommended for use within MIME 
  799.    charset parameters.
  800.  
  801.      charset = "US-ASCII"
  802.              | "ISO-8859-1" | "ISO-8859-2" | "ISO-8859-3"
  803.              | "ISO-8859-4" | "ISO-8859-5" | "ISO-8859-6"
  804.              | "ISO-8859-7" | "ISO-8859-8" | "ISO-8859-9"
  805.              | "ISO-2022-JP" | "ISO-2022-JP-2" | "ISO-2022-KR"
  806.              | "UNICODE-1-1" | "UNICODE-1-1-UTF-7" | "UNICODE-1-1-UTF-8"
  807.              | token
  808.  
  809.    Although HTTP allows an arbitrary token to be used as a charset 
  810.    value, any token that has a predefined value within the IANA 
  811.    Character Set registry [15] must represent the character set 
  812.    defined by that registry. Applications should limit their use of 
  813.    character sets to those defined by the IANA registry.
  814.  
  815.        Note: This use of the term "character set" is more commonly 
  816.        referred to as a "character encoding." However, since HTTP 
  817.        and MIME share the same registry, it is important that the 
  818.        terminology also be shared.
  819.  
  820. 3.5  Content Codings
  821.  
  822.    Content coding values are used to indicate an encoding 
  823.    transformation that has been applied to a resource. Content codings 
  824.    are primarily used to allow a document to be compressed or 
  825.    encrypted without losing the identity of its underlying media type. 
  826.    Typically, the resource is stored in this encoding and only decoded 
  827.    before rendering or analogous usage.
  828.  
  829.        content-coding = "x-gzip" | "x-compress" | token
  830.  
  831.        Note: For future compatibility, HTTP/1.0 applications should 
  832.        consider "gzip" and "compress" to be equivalent to "x-gzip" 
  833.        and "x-compress", respectively.
  834.  
  835.    All content-coding values are case-insensitive. HTTP/1.0 uses 
  836.    content-coding values in the Content-Encoding (Section 10.3) header 
  837.    field. Although the value describes the content-coding, what is 
  838.    more important is that it indicates what decoding mechanism will be 
  839.    required to remove the encoding. Note that a single program may be 
  840.    capable of decoding multiple content-coding formats. Two values are 
  841.    defined by this specification:
  842.  
  843.    x-gzip
  844.        An encoding format produced by the file compression program 
  845.        "gzip" (GNU zip) developed by Jean-loup Gailly. This format is 
  846.        typically a Lempel-Ziv coding (LZ77) with a 32 bit CRC. Gzip is 
  847.        available from the GNU project at 
  848.        <URL:ftp://prep.ai.mit.edu/pub/gnu/>.
  849.  
  850.    x-compress
  851.        The encoding format produced by the file compression program 
  852.        "compress". This format is an adaptive Lempel-Ziv-Welch coding 
  853.        (LZW).
  854.  
  855.        Note: Use of program names for the identification of 
  856.        encoding formats is not desirable and should be discouraged 
  857.        for future encodings. Their use here is representative of 
  858.        historical practice, not good design.
  859.  
  860. 3.6  Media Types
  861.  
  862.    HTTP uses Internet Media Types [13] in the Content-Type header 
  863.    field (Section 10.5) in order to provide open and extensible data 
  864.    typing. For mail applications, where there is no type negotiation 
  865.    between sender and recipient, it is reasonable to put strict limits 
  866.    on the set of allowed media types. With HTTP, where the sender and 
  867.    recipient can communicate directly, applications are allowed more 
  868.    freedom in the use of non-registered types. The following grammar 
  869.    for media types is a superset of that for MIME because it does not 
  870.    restrict itself to the official IANA and x-token types.
  871.  
  872.        media-type     = type "/" subtype *( ";" parameter )
  873.        type           = token
  874.        subtype        = token
  875.  
  876.     Parameters may follow the type/subtype in the form of 
  877.    attribute/value pairs.
  878.  
  879.        parameter      = attribute "=" value
  880.        attribute      = token
  881.        value          = token | quoted-string
  882.  
  883.    The type, subtype, and parameter attribute names are 
  884.    case-insensitive. Parameter values may or may not be 
  885.    case-sensitive, depending on the semantics of the parameter name. 
  886.    LWS must not be generated between the type and subtype, nor between 
  887.    an attribute and its value.
  888.  
  889.    Many current applications do not recognize media type parameters. 
  890.    Since parameters are a fundamental aspect of media types, this must 
  891.    be considered an error in those applications. Nevertheless, 
  892.    HTTP/1.0 applications should only use media type parameters when 
  893.    they are necessary to define the content of a message.
  894.  
  895.    If a given media-type value has been registered by the IANA, any 
  896.    use of that value must be indicative of the registered data format. 
  897.    Although HTTP allows the use of non-registered media types, such 
  898.    usage must not conflict with the IANA registry. Data providers are 
  899.    strongly encouraged to register their media types with IANA via the 
  900.    procedures outlined in RFC 1590 [13].
  901.  
  902.    All media-type's registered by IANA must be preferred over 
  903.    extension tokens. However, HTTP does not limit applications to the 
  904.    use of officially registered media types, nor does it encourage the 
  905.    use of an "x-" prefix for unofficial types outside of explicitly 
  906.    short experimental use between consenting applications.
  907.  
  908. 3.6.1 Canonicalization and Text Defaults
  909.  
  910.    Media types are registered in a canonical form. In general, entity 
  911.    bodies transferred via HTTP must be represented in the appropriate 
  912.    canonical form prior to transmission. If the body has been encoded 
  913.    via a Content-Encoding, the data must be in canonical form prior to 
  914.    that encoding. However, HTTP modifies the canonical form 
  915.    requirements for media of primary type "text" and for "application" 
  916.    types consisting of text-like records.
  917.  
  918.    HTTP redefines the canonical form of text media to allow multiple 
  919.    octet sequences to indicate a text line break. In addition to the 
  920.    preferred form of CRLF, HTTP applications must accept a bare CR or 
  921.    LF alone as representing a single line break in text media. 
  922.    Furthermore, if the text media is represented in a character set 
  923.    which does not use octets 13 and 10 for CR and LF respectively, as 
  924.    is the case for some multi-byte character sets, HTTP allows the use 
  925.    of whatever octet sequence(s) is defined by that character set to 
  926.    represent the equivalent of CRLF, bare CR, and bare LF. It is 
  927.    assumed that any recipient capable of using such a character set 
  928.    will know the appropriate octet sequence for representing line 
  929.    breaks within that character set.
  930.  
  931.        Note: This interpretation of line breaks applies only to the 
  932.        contents of an Entity-Body and only after any 
  933.        Content-Encoding has been removed. All other HTTP constructs 
  934.        use CRLF exclusively to indicate a line break. Content 
  935.        codings define their own line break requirements.
  936.  
  937.    A recipient of an HTTP text entity should translate the received 
  938.    entity line breaks to the local line break conventions before 
  939.    saving the entity external to the application and its cache; 
  940.    whether this translation takes place immediately upon receipt of 
  941.    the entity, or only when prompted by the user, is entirely up to 
  942.    the individual application.
  943.  
  944.    HTTP also redefines the default character set for text media in an 
  945.    entity body. If a textual media type defines a charset parameter 
  946.    with a registered default value of "US-ASCII", HTTP changes the 
  947.    default to be "ISO-8859-1". Since the ISO-8859-1 [18] character set 
  948.    is a superset of US-ASCII [17], this has no effect upon the 
  949.    interpretation of entity bodies which only contain octets within 
  950.    the US-ASCII set (0 - 127). The presence of a charset parameter 
  951.    value in a Content-Type header field overrides the default.
  952.  
  953.    It is recommended that the character set of an entity body be 
  954.    labelled as the lowest common denominator of the character codes 
  955.    used within a document, with the exception that no label is 
  956.    preferred over the labels US-ASCII or ISO-8859-1.
  957.  
  958. 3.6.2 Multipart Types
  959.  
  960.    MIME provides for a number of "multipart" types -- encapsulations of 
  961.    several entities within a single message's Entity-Body. The 
  962.    multipart types registered by IANA [15] do not have any special 
  963.    meaning for HTTP/1.0, though user agents may need to understand 
  964.    each type in order to correctly interpret the purpose of each 
  965.    body-part. Ideally, an HTTP user agent should follow the same or 
  966.    similar behavior as a MIME user agent does upon receipt of a 
  967.    multipart type.
  968.  
  969.    As in MIME [5], all multipart types share a common syntax and must 
  970.    include a boundary parameter as part of the media type value. The 
  971.    message body is itself a protocol element and must therefore use 
  972.    only CRLF to represent line breaks between body-parts. Unlike in 
  973.    MIME, multipart body-parts may contain HTTP header fields which are 
  974.    significant to the meaning of that part.
  975.  
  976. 3.7  Product Tokens
  977.  
  978.    Product tokens are used to allow communicating applications to 
  979.    identify themselves via a simple product token, with an optional 
  980.    slash and version designator. Most fields using product tokens also 
  981.    allow subproducts which form a significant part of the application 
  982.    to be listed, separated by whitespace. By convention, the products 
  983.    are listed in order of their significance for identifying the 
  984.    application.
  985.  
  986.        product         = token ["/" product-version]
  987.        product-version = token
  988.  
  989.    Examples:
  990.  
  991.        User-Agent: CERN-LineMode/2.15 libwww/2.17b3
  992.  
  993.        Server: Apache/0.8.4
  994.  
  995.    Product tokens should be short and to the point -- use of them for 
  996.    advertizing or other non-essential information is explicitly 
  997.    forbidden. Although any token character may appear in a 
  998.    product-version, this token should only be used for a version 
  999.    identifier (i.e., successive versions of the same product should 
  1000.    only differ in the product-version portion of the product value).
  1001.  
  1002. 4.  HTTP Message
  1003.  
  1004. 4.1  Message Types
  1005.  
  1006.    HTTP messages consist of requests from client to server and 
  1007.    responses from server to client.
  1008.  
  1009.        HTTP-message   = Simple-Request           ; HTTP/0.9 messages
  1010.                       | Simple-Response
  1011.                       | Full-Request             ; HTTP/1.0 messages
  1012.                       | Full-Response
  1013.  
  1014.    Full-Request and Full-Response use the generic message format of 
  1015.    RFC 822 [7] for transferring entities. Both messages may include 
  1016.    optional header fields (also known as "headers") and an entity 
  1017.    body. The entity body is separated from the headers by a null line 
  1018.    (i.e., a line with nothing preceding the CRLF).
  1019.  
  1020.        Full-Request   = Request-Line             ; Section 5.1
  1021.                         *( General-Header        ; Section 4.3
  1022.                         |  Request-Header        ; Section 5.2
  1023.                         |  Entity-Header )       ; Section 7.1
  1024.                         CRLF
  1025.                         [ Entity-Body ]          ; Section 7.2
  1026.  
  1027.        Full-Response  = Status-Line              ; Section 6.1
  1028.                         *( General-Header        ; Section 4.3
  1029.                         |  Response-Header       ; Section 6.2
  1030.                         |  Entity-Header )       ; Section 7.1
  1031.                         CRLF
  1032.                         [ Entity-Body ]          ; Section 7.2
  1033.  
  1034.    Simple-Request and Simple-Response do not allow the use of any 
  1035.    header information and are limited to a single request method (GET).
  1036.  
  1037.        Simple-Request  = "GET" SP Request-URI CRLF
  1038.  
  1039.        Simple-Response = [ Entity-Body ]
  1040.  
  1041.    Use of the Simple-Request format is discouraged because it prevents 
  1042.    the server from identifying the media type of the returned entity.
  1043.  
  1044. 4.2  Message Headers
  1045.  
  1046.    HTTP header fields, which include General-Header (Section 4.3), 
  1047.    Request-Header (Section 5.2), Response-Header (Section 6.2), and 
  1048.    Entity-Header (Section 7.1) fields, follow the same generic format 
  1049.    as that given in Section 3.1 of RFC 822 [7]. Each header field 
  1050.    consists of a name followed immediately by a colon (":"), a single 
  1051.    space (SP) character, and the field value. Field names are 
  1052.    case-insensitive. Header fields can be extended over multiple lines 
  1053.    by preceding each extra line with at least one SP or HT, though 
  1054.    this is not recommended.
  1055.  
  1056.        HTTP-header    = field-name ":" [ field-value ] CRLF
  1057.  
  1058.        field-name     = token
  1059.        field-value    = *( field-content | LWS )
  1060.  
  1061.        field-content  = <the OCTETs making up the field-value
  1062.                         and consisting of either *TEXT or combinations
  1063.                         of token, tspecials, and quoted-string>
  1064.  
  1065.    The order in which header fields are received is not significant. 
  1066.    However, it is "good practice" to send General-Header fields first, 
  1067.    followed by Request-Header or Response-Header fields prior to the 
  1068.    Entity-Header fields.
  1069.  
  1070.    Multiple HTTP-header fields with the same field-name may be present 
  1071.    in a message if and only if the entire field-value for that header 
  1072.    field is defined as a comma-separated list [i.e., #(values)]. It 
  1073.    must be possible to combine the multiple header fields into one 
  1074.    "field-name: field-value" pair, without changing the semantics of 
  1075.    the message, by appending each subsequent field-value to the first, 
  1076.    each separated by a comma.
  1077.  
  1078. 4.3  General Header Fields
  1079.  
  1080.    There are a few header fields which have general applicability for 
  1081.    both request and response messages, but which do not apply to the 
  1082.    entity being transferred. These headers apply only to the message 
  1083.    being transmitted.
  1084.  
  1085.        General-Header = Date                     ; Section 10.6
  1086.                       | MIME-Version             ; Section 10.12
  1087.                       | Pragma                   ; Section 10.13
  1088.  
  1089.    General header field names can be extended reliably only in 
  1090.    combination with a change in the protocol version. However, new or 
  1091.    experimental header fields may be given the semantics of general 
  1092.    header fields if all parties in the communication recognize them to 
  1093.    be general header fields. Unknown header fields are treated as 
  1094.    Entity-Header fields.
  1095.  
  1096. 5. Request
  1097.  
  1098.    A request message from a client to a server includes, within the 
  1099.    first line of that message, the method to be applied to the 
  1100.    resource, the identifier of the resource, and the protocol version 
  1101.    in use. For backwards compatibility with the more limited HTTP/0.9 
  1102.    protocol, there are two valid formats for an HTTP request:
  1103.  
  1104.        Request        = Simple-Request | Full-Request
  1105.  
  1106.        Simple-Request = "GET" SP Request-URI CRLF
  1107.  
  1108.        Full-Request   = Request-Line             ; Section 5.1
  1109.                         *( General-Header        ; Section 4.3
  1110.                         |  Request-Header        ; Section 5.2
  1111.                         |  Entity-Header )       ; Section 7.1
  1112.                         CRLF
  1113.                         [ Entity-Body ]          ; Section 7.2
  1114.  
  1115.    If an HTTP/1.0 server receives a Simple-Request, it must respond 
  1116.    with an HTTP/0.9 Simple-Response. An HTTP/1.0 client capable of 
  1117.    receiving a Full-Response should never generate a Simple-Request.
  1118.  
  1119. 5.1  Request-Line
  1120.  
  1121.    The Request-Line begins with a method token, followed by the 
  1122.    Request-URI and the protocol version, and ending with CRLF. The 
  1123.    elements are separated by SP characters. No CR or LF are allowed 
  1124.    except in the final CRLF sequence.
  1125.  
  1126.        Request-Line   = Method SP Request-URI SP HTTP-Version CRLF
  1127.  
  1128.    Note that the difference between a Simple-Request and the 
  1129.    Request-Line of a Full-Request is the presence of the HTTP-Version 
  1130.    field and the availability of methods other than GET.
  1131.  
  1132. 5.1.1 Method
  1133.  
  1134.    The Method token indicates the method to be performed on the 
  1135.    resource identified by the Request-URI. The method is 
  1136.    case-sensitive.
  1137.  
  1138.        Method         = "GET"                    ; Section 8.1
  1139.                       | "HEAD"                   ; Section 8.2
  1140.                       | "POST"                   ; Section 8.3
  1141.                       | extension-method
  1142.  
  1143.        extension-method = token
  1144.  
  1145.    The list of methods acceptable by a specific resource can change 
  1146.    dynamically; the client is notified through the return code of the 
  1147.    response if a method is not allowed on a resource. Servers should 
  1148.    return the status code 501 (not implemented) if the method is 
  1149.    unknown or not implemented.
  1150.  
  1151.    The methods commonly used by HTTP/1.0 applications are fully 
  1152.    defined in Section 8.
  1153.  
  1154. 5.1.2 Request-URI
  1155.  
  1156.    The Request-URI is a Uniform Resource Identifier (Section 3.2) and 
  1157.    identifies the resource upon which to apply the request.
  1158.  
  1159.        Request-URI    = absoluteURI | abs_path
  1160.  
  1161.    The two options for Request-URI are dependent on the nature of the 
  1162.    request.
  1163.  
  1164.    The absoluteURI form is only allowed when the request is being made 
  1165.    to a proxy. The proxy is requested to forward the request and 
  1166.    return the response. If the request is GET or HEAD and a prior 
  1167.    response is cached, the proxy may use the cached message if it 
  1168.    passes any restrictions in the Expires header field. Note that the 
  1169.    proxy may forward the request on to another proxy or directly to 
  1170.    the server specified by the absoluteURI. In order to avoid request 
  1171.    loops, a proxy must be able to recognize all of its server names, 
  1172.    including any aliases, local variations, and the numeric IP 
  1173.    address. An example Request-Line would be:
  1174.  
  1175.        GET http://www.w3.org/hypertext/WWW/TheProject.html HTTP/1.0
  1176.  
  1177.    The most common form of Request-URI is that used to identify a 
  1178.    resource on an origin server or gateway. In this case, only the 
  1179.    absolute path of the URI is transmitted (see Section 3.2.1, 
  1180.    abs_path). For example, a client wishing to retrieve the resource 
  1181.    above directly from the origin server would create a TCP connection 
  1182.    to port 80 of the host "www.w3.org" and send the line:
  1183.  
  1184.        GET /hypertext/WWW/TheProject.html HTTP/1.0
  1185.  
  1186.    followed by the remainder of the Full-Request. Note that the 
  1187.    absolute path cannot be empty; if none is present in the original 
  1188.    URI, it must be given as "/" (the server root).
  1189.  
  1190.    The Request-URI is transmitted as an encoded string, where some 
  1191.    characters may be escaped using the "% hex hex" encoding defined by 
  1192.    RFC 1738 [4]. The origin server must decode the Request-URI in 
  1193.    order to properly interpret the request.
  1194.  
  1195. 5.2  Request Header Fields
  1196.  
  1197.    The request header fields allow the client to pass additional 
  1198.    information about the request, and about the client itself, to the 
  1199.    server. All header fields are optional and conform to the generic 
  1200.    HTTP-header syntax.
  1201.  
  1202.        Request-Header = Authorization            ; Section 10.2
  1203.                       | From                     ; Section 10.8
  1204.                       | If-Modified-Since        ; Section 10.9
  1205.                       | Referer                  ; Section 10.14
  1206.                       | User-Agent               ; Section 10.16
  1207.  
  1208.    Request-Header field names can be extended reliably only in 
  1209.    combination with a change in the protocol version. However, new or 
  1210.    experimental header fields may be given the semantics of request 
  1211.    header fields if all parties in the communication recognize them to 
  1212.    be request header fields. Unknown header fields are treated as 
  1213.    Entity-Header fields.
  1214.  
  1215. 6.  Response
  1216.  
  1217.    After receiving and interpreting a request message, a server 
  1218.    responds in the form of an HTTP response message.
  1219.  
  1220.        Response        = Simple-Response | Full-Response
  1221.  
  1222.        Simple-Response = [ Entity-Body ]
  1223.  
  1224.        Full-Response   = Status-Line             ; Section 6.1
  1225.                          *( General-Header       ; Section 4.3
  1226.                          |  Response-Header      ; Section 6.2
  1227.                          |  Entity-Header )      ; Section 7.1
  1228.                          CRLF
  1229.                          [ Entity-Body ]         ; Section 7.2
  1230.  
  1231.    A Simple-Response should only be sent in response to an HTTP/0.9 
  1232.    Simple-Request or if the server only supports the more limited 
  1233.    HTTP/0.9 protocol. If a client sends an HTTP/1.0 Full-Request and 
  1234.    receives a response that does not begin with a Status-Line, it 
  1235.    should assume that the response is a Simple-Response and parse it 
  1236.    accordingly. Note that the Simple-Response consists only of the 
  1237.    entity body and is terminated by the server closing the connection.
  1238.  
  1239. 6.1  Status-Line
  1240.  
  1241.    The first line of a Full-Response message is the Status-Line, 
  1242.    consisting of the protocol version followed by a numeric status 
  1243.    code and its associated textual phrase, with each element separated 
  1244.    by SP characters. No CR or LF is allowed except in the final CRLF 
  1245.    sequence.
  1246.  
  1247.        Status-Line = HTTP-Version SP Status-Code SP Reason-Phrase CRLF
  1248.  
  1249.    Since a status line always begins with the protocol version and 
  1250.    status code
  1251.  
  1252.        "HTTP/" 1*DIGIT "." 1*DIGIT SP 3DIGIT SP
  1253.  
  1254.    (e.g., "HTTP/1.0 200 "), the presence of that expression is 
  1255.    sufficient to differentiate a Full-Response from a Simple-Response. 
  1256.    Although the Simple-Response format may allow such an expression to 
  1257.    occur at the beginning of an entity body, and thus cause a 
  1258.    misinterpretation of the message if it was given in response to a 
  1259.    Full-Request, most HTTP/0.9 servers are limited to responses of 
  1260.    type "text/html" and therefore would never generate such a response.
  1261.  
  1262. 6.1.1 Status Code and Reason Phrase
  1263.  
  1264.    The Status-Code element is a 3-digit integer result code of the 
  1265.    attempt to understand and satisfy the request. The Reason-Phrase is 
  1266.    intended to give a short textual description of the Status-Code. 
  1267.    The Status-Code is intended for use by automata and the 
  1268.    Reason-Phrase is intended for the human user. The client is not 
  1269.    required to examine or display the Reason-Phrase.
  1270.  
  1271.    The first digit of the Status-Code defines the class of response. 
  1272.    The last two digits do not have any categorization role. There are 
  1273.    5 values for the first digit:
  1274.  
  1275.       o 1xx: Informational - Not used, but reserved for future use
  1276.  
  1277.       o 2xx: Success - The action was successfully received, 
  1278.              understood, and accepted.
  1279.  
  1280.       o 3xx: Redirection - Further action must be taken in order to 
  1281.              complete the request
  1282.  
  1283.       o 4xx: Client Error - The request contains bad syntax or cannot 
  1284.              be fulfilled
  1285.  
  1286.       o 5xx: Server Error - The server failed to fulfill an apparently 
  1287.              valid request
  1288.  
  1289.    The individual values of the numeric status codes defined for 
  1290.    HTTP/1.0, and an example set of corresponding Reason-Phrase's, are 
  1291.    presented below. The reason phrases listed here are only 
  1292.    recommended -- they may be replaced by local equivalents without 
  1293.    affecting the protocol. These codes are fully defined in Section 9.
  1294.  
  1295.        Status-Code    = "200"   ; OK
  1296.                       | "201"   ; Created
  1297.                       | "202"   ; Accepted
  1298.                       | "204"   ; No Content
  1299.                       | "301"   ; Moved Permanently
  1300.                       | "302"   ; Moved Temporarily
  1301.                       | "304"   ; Not Modified
  1302.                       | "400"   ; Bad Request
  1303.                       | "401"   ; Unauthorized
  1304.                       | "403"   ; Forbidden
  1305.                       | "404"   ; Not Found
  1306.                       | "500"   ; Internal Server Error
  1307.                       | "501"   ; Not Implemented
  1308.                       | "502"   ; Bad Gateway
  1309.                       | "503"   ; Service Unavailable
  1310.                       | extension-code
  1311.  
  1312.        extension-code = 3DIGIT
  1313.  
  1314.        Reason-Phrase  = *<TEXT, excluding CR, LF>
  1315.  
  1316.    HTTP status codes are extensible, but the above codes are the only 
  1317.    ones generally recognized in current practice. HTTP applications 
  1318.    are not required to understand the meaning of all registered status 
  1319.    codes, though such understanding is obviously desirable. However, 
  1320.    applications must understand the class of any status code, as 
  1321.    indicated by the first digit, and treat any unknown response as 
  1322.    being equivalent to the x00 status code of that class. For example, 
  1323.    if an unknown status code of 421 is received by the client, it can 
  1324.    safely assume that there was something wrong with its request and 
  1325.    treat the response as if it had received a 400 status code. In such 
  1326.    cases, user agents should present to the user the entity returned 
  1327.    with the response, since that entity is likely to include 
  1328.    human-readable information which will explain the unusual status.
  1329.  
  1330. 6.2  Response Header Fields
  1331.  
  1332.    The response header fields allow the server to pass additional 
  1333.    information about the response which cannot be placed in the 
  1334.    Status-Line. These header fields are not intended to give 
  1335.    information about an Entity-Body returned in the response, but 
  1336.    about the server itself.
  1337.  
  1338.        Response-Header = Location                ; Section 10.11
  1339.                        | Server                  ; Section 10.15
  1340.                        | WWW-Authenticate        ; Section 10.17
  1341.  
  1342.    Response-Header field names can be extended reliably only in 
  1343.    combination with a change in the protocol version. However, new or 
  1344.    experimental header fields may be given the semantics of response 
  1345.    header fields if all parties in the communication recognize them to 
  1346.    be response header fields. Unknown header fields are treated as 
  1347.    Entity-Header fields.
  1348.  
  1349. 7.  Entity
  1350.  
  1351.    Full-Request and Full-Response messages may transfer an entity 
  1352.    within some requests and responses. An entity consists of 
  1353.    Entity-Header fields and (usually) an Entity-Body. In this section, 
  1354.    both sender and recipient refer to either the client or the server, 
  1355.    depending on who sends and who receives the entity.
  1356.  
  1357. 7.1  Entity Header Fields
  1358.  
  1359.    Entity-Header fields define optional metainformation about the 
  1360.    Entity-Body or, if no body is present, about the resource 
  1361.    identified by the request.
  1362.  
  1363.        Entity-Header  = Allow                    ; Section 10.1
  1364.                       | Content-Encoding         ; Section 10.3
  1365.                       | Content-Length           ; Section 10.4
  1366.                       | Content-Type             ; Section 10.5
  1367.                       | Expires                  ; Section 10.7
  1368.                       | Last-Modified            ; Section 10.10
  1369.                       | extension-header
  1370.  
  1371.        extension-header = HTTP-header
  1372.  
  1373.    The extension-header mechanism allows additional Entity-Header 
  1374.    fields to be defined without changing the protocol, but these 
  1375.    fields cannot be assumed to be recognizable by the recipient. 
  1376.    Unknown header fields should be ignored by the recipient and 
  1377.    forwarded by proxies.
  1378.  
  1379. 7.2  Entity Body
  1380.  
  1381.    The entity body (if any) sent with an HTTP/1.0 request or response 
  1382.    is in a format and encoding defined by the Entity-Header fields.
  1383.  
  1384.        Entity-Body    = *OCTET
  1385.  
  1386.    An entity body is included with a request message only when the 
  1387.    request method calls for one. The presence of an entity body in a 
  1388.    request is signaled by the inclusion of a Content-Length header 
  1389.    field in the request message headers. HTTP/1.0 requests containing 
  1390.    an entity body must include a valid Content-Length header field.
  1391.  
  1392.    For response messages, whether or not an entity body is included 
  1393.    with a message is dependent on both the request method and the 
  1394.    response code. All responses to the HEAD request method must not 
  1395.    include a body, even though the presence of entity header fields 
  1396.    may lead one to believe they do. All 1xx (informational), 204 (no 
  1397.    content), and 304 (not modified) responses must not include a body. 
  1398.    All other responses must include an entity body or a Content-Length 
  1399.    header field defined with a value of zero (0).
  1400.  
  1401. 7.2.1 Type
  1402.  
  1403.    When an Entity-Body is included with a message, the data type of 
  1404.    that body is determined via the header fields Content-Type and 
  1405.    Content-Encoding. These define a two-layer, ordered encoding model:
  1406.  
  1407.        entity-body := Content-Encoding( Content-Type( data ) )
  1408.  
  1409.    A Content-Type specifies the media type of the underlying data. A 
  1410.    Content-Encoding may be used to indicate any additional content 
  1411.    coding applied to the type, usually for the purpose of data 
  1412.    compression, that is a property of the resource requested. The 
  1413.    default for the content encoding is none (i.e., the identity 
  1414.    function).
  1415.  
  1416.    Any HTTP/1.0 message containing an entity body should include a 
  1417.    Content-Type header field defining the media type of that body. If 
  1418.    and only if the media type is not given by a Content-Type header, 
  1419.    as is the case for Simple-Response messages, the recipient may 
  1420.    attempt to guess the media type via inspection of its content 
  1421.    and/or the name extension(s) of the URL used to identify the 
  1422.    resource. If the media type remains unknown, the recipient should 
  1423.    treat it as type "application/octet-stream".
  1424.  
  1425. 7.2.2 Length
  1426.  
  1427.    When an Entity-Body is included with a message, the length of that 
  1428.    body may be determined in one of two ways. If a Content-Length 
  1429.    header field is present, its value in bytes represents the length 
  1430.    of the Entity-Body. Otherwise, the body length is determined by the 
  1431.    closing of the connection by the server.
  1432.  
  1433.    Closing the connection cannot be used to indicate the end of a 
  1434.    request body, since it leaves no possibility for the server to send 
  1435.    back a response. Therefore, HTTP/1.0 requests containing an entity 
  1436.    body must include a valid Content-Length header field. If a request 
  1437.    contains an entity body and Content-Length is not specified, and 
  1438.    the server does not recognize or cannot calculate the length from 
  1439.    other fields, then the server should send a 400 (bad request) 
  1440.    response.
  1441.  
  1442.        Note: Some older servers supply an invalid Content-Length 
  1443.        when sending a document that contains server-side includes 
  1444.        dynamically inserted into the data stream. It must be 
  1445.        emphasized that this will not be tolerated by future 
  1446.        versions of HTTP. Unless the client knows that it is 
  1447.        receiving a response from a compliant server, it should not 
  1448.        depend on the Content-Length value being correct.
  1449.  
  1450. 8.  Method Definitions
  1451.  
  1452.    The set of common methods for HTTP/1.0 is defined below. Although 
  1453.    this set can be expanded, additional methods cannot be assumed to 
  1454.    share the same semantics for separately extended clients and 
  1455.    servers.
  1456.  
  1457. 8.1  GET
  1458.  
  1459.    The GET method means retrieve whatever information (in the form of 
  1460.    an entity) is identified by the Request-URI. If the Request-URI 
  1461.    refers to a data-producing process, it is the produced data which 
  1462.    shall be returned as the entity in the response and not the source 
  1463.    text of the process, unless that text happens to be the output of 
  1464.    the process.
  1465.  
  1466.    The semantics of the GET method changes to a "conditional GET" if 
  1467.    the request message includes an If-Modified-Since header field. A 
  1468.    conditional GET method requests that the identified resource be 
  1469.    transferred only if it has been modified since the date given by 
  1470.    the If-Modified-Since header, as described in Section 10.9. The 
  1471.    conditional GET method is intended to reduce network usage by 
  1472.    allowing cached entities to be refreshed without requiring multiple 
  1473.    requests or transferring unnecessary data.
  1474.  
  1475. 8.2  HEAD
  1476.  
  1477.    The HEAD method is identical to GET except that the server must not 
  1478.    return any Entity-Body in the response. The metainformation 
  1479.    contained in the HTTP headers in response to a HEAD request should 
  1480.    be identical to the information sent in response to a GET request. 
  1481.    This method can be used for obtaining metainformation about the 
  1482.    resource identified by the Request-URI without transferring the 
  1483.    Entity-Body itself. This method is often used for testing hypertext 
  1484.    links for validity, accessibility, and recent modification.
  1485.  
  1486.    There is no "conditional HEAD" request analogous to the conditional 
  1487.    GET. If an If-Modified-Since header field is included with a HEAD 
  1488.    request, it should be ignored.
  1489.  
  1490. 8.3  POST
  1491.  
  1492.    The POST method is used to request that the destination server 
  1493.    accept the entity enclosed in the request as a new subordinate of 
  1494.    the resource identified by the Request-URI in the Request-Line. 
  1495.    POST is designed to allow a uniform method to cover the following 
  1496.    functions:
  1497.  
  1498.       o Annotation of existing resources; 
  1499.  
  1500.       o Posting a message to a bulletin board, newsgroup, mailing list, 
  1501.         or similar group of articles;
  1502.  
  1503.       o Providing a block of data, such as the result of submitting a 
  1504.         form [3], to a data-handling process;
  1505.  
  1506.       o Extending a database through an append operation.
  1507.  
  1508.    The actual function performed by the POST method is determined by 
  1509.    the server and is usually dependent on the Request-URI. The posted 
  1510.    entity is subordinate to that URI in the same way that a file is 
  1511.    subordinate to a directory containing it, a news article is 
  1512.    subordinate to a newsgroup to which it is posted, or a record is 
  1513.    subordinate to a database.
  1514.  
  1515.    A successful POST does not require that the entity be created as a 
  1516.    resource on the origin server or made accessible for future 
  1517.    reference. That is, the action performed by the POST method might 
  1518.    not result in a resource that can be identified by a URI. In this 
  1519.    case, either 200 (ok) or 204 (no content) is the appropriate 
  1520.    response status, depending on whether or not the response includes 
  1521.    an entity that describes the result.
  1522.  
  1523.    If a resource has been created on the origin server, the response 
  1524.    should be 201 (created) and contain an entity (preferably of type 
  1525.    "text/html") which describes the status of the request and refers 
  1526.    to the new resource.
  1527.  
  1528.    A valid Content-Length is required on all HTTP/1.0 POST requests. 
  1529.    An HTTP/1.0 server should respond with a 400 (bad request) message 
  1530.    if it cannot determine the length of the request message's content.
  1531.  
  1532.    Applications must not cache responses to a POST request.
  1533.  
  1534. 9.  Status Code Definitions
  1535.  
  1536.    Each Status-Code is described below, including a description of 
  1537.    which method(s) it can follow and any metainformation required in 
  1538.    the response.
  1539.  
  1540. 9.1  Informational 1xx
  1541.  
  1542.    This class of status code indicates a provisional response, 
  1543.    consisting only of the Status-Line and optional headers, and is 
  1544.    terminated by an empty line. HTTP/1.0 does not define any 1xx 
  1545.    status codes and they are not a valid response to a HTTP/1.0 
  1546.    request. However, they may be useful for experimental applications 
  1547.    which are outside the scope of this specification.
  1548.  
  1549. 9.2  Successful 2xx
  1550.  
  1551.    This class of status code indicates that the client's request was 
  1552.    successfully received, understood, and accepted.
  1553.  
  1554.    200 OK
  1555.  
  1556.    The request has succeeded. The information returned with the 
  1557.    response is dependent on the method used in the request, as follows:
  1558.  
  1559.    GET    an entity corresponding to the requested resource is sent 
  1560.           in the response;
  1561.  
  1562.    HEAD   the response must only contain the header information and 
  1563.           no Entity-Body;
  1564.  
  1565.    POST   an entity describing or containing the result of the action.
  1566.  
  1567.    201 Created
  1568.  
  1569.    The request has been fulfilled and resulted in a new resource being 
  1570.    created. The newly created resource can be referenced by the URI(s) 
  1571.    returned in the entity of the response. The origin server should 
  1572.    create the resource before using this Status-Code. If the action 
  1573.    cannot be carried out immediately, the server must include in the 
  1574.    response body a description of when the resource will be available; 
  1575.    otherwise, the server should respond with 202 (accepted).
  1576.  
  1577.    Of the methods defined by this specification, only POST can create 
  1578.    a resource.
  1579.  
  1580.    202 Accepted
  1581.  
  1582.    The request has been accepted for processing, but the processing 
  1583.    has not been completed. The request may or may not eventually be 
  1584.    acted upon, as it may be disallowed when processing actually takes 
  1585.    place. There is no facility for re-sending a status code from an 
  1586.    asynchronous operation such as this.
  1587.  
  1588.    The 202 response is intentionally non-committal. Its purpose is to 
  1589.    allow a server to accept a request for some other process (perhaps 
  1590.    a batch-oriented process that is only run once per day) without 
  1591.    requiring that the user agent's connection to the server persist 
  1592.    until the process is completed. The entity returned with this 
  1593.    response should include an indication of the request's current 
  1594.    status and either a pointer to a status monitor or some estimate of 
  1595.    when the user can expect the request to be fulfilled.
  1596.  
  1597.    204 No Content
  1598.  
  1599.    The server has fulfilled the request but there is no new 
  1600.    information to send back. If the client is a user agent, it should 
  1601.    not change its document view from that which caused the request to 
  1602.    be generated. This response is primarily intended to allow input 
  1603.    for scripts or other actions to take place without causing a change 
  1604.    to the user agent's active document view. The response may include 
  1605.    new metainformation in the form of entity headers, which should 
  1606.    apply to the document currently in the user agent's active view.
  1607.  
  1608. 9.3  Redirection 3xx
  1609.  
  1610.    This class of status code indicates that further action needs to be 
  1611.    taken by the user agent in order to fulfill the request. The action 
  1612.    required can sometimes be carried out by the user agent without 
  1613.    interaction with the user, but it is strongly recommended that this 
  1614.    only take place if the method used in the request is GET or HEAD. A 
  1615.    user agent should never automatically redirect a request more than 
  1616.    5 times, since such redirections usually indicate an infinite loop.
  1617.  
  1618.    300 Multiple Choices
  1619.  
  1620.    This response code is not directly used by HTTP/1.0 applications, 
  1621.    but serves as the default for interpreting the 3xx class of 
  1622.    responses.
  1623.  
  1624.    The requested resource is available at one or more locations. 
  1625.    Unless it was a HEAD request, the response should include an entity 
  1626.    containing a list of resource characteristics and locations from 
  1627.    which the user or user agent can choose the one most appropriate. 
  1628.    If the server has a preferred choice, it should include the URL in 
  1629.    a Location field; user agents may use this field value for 
  1630.    automatic redirection.
  1631.  
  1632.    301 Moved Permanently
  1633.  
  1634.    The requested resource has been assigned a new permanent URL and 
  1635.    any future references to this resource should be done using that 
  1636.    URL. Clients with link editing capabilities should automatically 
  1637.    relink references to the Request-URI to the new reference returned 
  1638.    by the server, where possible.
  1639.  
  1640.    The new URL must be given by the Location field in the response. 
  1641.    Unless it was a HEAD request, the Entity-Body of the response 
  1642.    should contain a short note with a hyperlink to the new URL.
  1643.  
  1644.    If the 301 status code is received in response to a request using 
  1645.    the POST method, the user agent must not automatically redirect the 
  1646.    request unless it can be confirmed by the user, since this might 
  1647.    change the conditions under which the request was issued.
  1648.  
  1649.    302 Moved Temporarily
  1650.  
  1651.    The requested resource resides temporarily under a different URL. 
  1652.    Since the redirection may be altered on occasion, the client should 
  1653.    continue to use the Request-URI for future requests.
  1654.  
  1655.    The URL must be given by the Location field in the response. Unless 
  1656.    it was a HEAD request, the Entity-Body of the response should 
  1657.    contain a short note with a hyperlink to the new URI(s).
  1658.  
  1659.    If the 302 status code is received in response to a request using 
  1660.    the POST method, the user agent must not automatically redirect the 
  1661.    request unless it can be confirmed by the user, since this might 
  1662.    change the conditions under which the request was issued.
  1663.  
  1664.    304 Not Modified
  1665.  
  1666.    If the client has performed a conditional GET request and access is 
  1667.    allowed, but the document has not been modified since the date and 
  1668.    time specified in the If-Modified-Since field, the server must 
  1669.    respond with this status code and not send an Entity-Body to the 
  1670.    client. Header fields contained in the response should only include 
  1671.    information which is relevant to cache managers or which may have 
  1672.    changed independently of the entity's Last-Modified date. Examples 
  1673.    of relevant header fields include: Date, Server, and Expires. A 
  1674.    cache should update its cached entity to reflect any new field 
  1675.    values given in the 304 response.
  1676.  
  1677. 9.4  Client Error 4xx
  1678.  
  1679.    The 4xx class of status code is intended for cases in which the 
  1680.    client seems to have erred. If the client has not completed the 
  1681.    request when a 4xx code is received, it should immediately cease 
  1682.    sending data to the server. Except when responding to a HEAD 
  1683.    request, the server should include an entity containing an 
  1684.    explanation of the error situation, and whether it is a temporary 
  1685.    or permanent condition. These status codes are applicable to any 
  1686.    request method.
  1687.  
  1688.        Note: If the client is sending data, server implementations 
  1689.        on TCP should be careful to ensure that the client 
  1690.        acknowledges receipt of the packet(s) containing the 
  1691.        response prior to closing the input connection. If the 
  1692.        client continues sending data to the server after the close, 
  1693.        the server's controller will send a reset packet to the 
  1694.        client, which may erase the client's unacknowledged input 
  1695.        buffers before they can be read and interpreted by the HTTP 
  1696.        application.
  1697.  
  1698.    400 Bad Request
  1699.  
  1700.    The request could not be understood by the server due to malformed 
  1701.    syntax. The client should not repeat the request without 
  1702.    modifications.
  1703.  
  1704.    401 Unauthorized
  1705.  
  1706.    The request requires user authentication. The response must include 
  1707.    a WWW-Authenticate header field (Section 10.17) containing a 
  1708.    challenge applicable to the requested resource. The client may 
  1709.    repeat the request with a suitable Authorization header field 
  1710.    (Section 10.2). If the request already included Authorization 
  1711.    credentials, then the 401 response indicates that authorization has 
  1712.    been refused for those credentials. If the 401 response contains 
  1713.    the same challenge as the prior response, and the user agent has 
  1714.    already attempted authentication at least once, then the user 
  1715.    should be presented the entity that was given in the response, 
  1716.    since that entity may include relevent diagnostic information. HTTP 
  1717.    access authentication is explained in Section 11.
  1718.  
  1719.    403 Forbidden
  1720.  
  1721.    The server understood the request, but is refusing to fulfill it. 
  1722.    Authorization will not help and the request should not be repeated. 
  1723.    If the request method was not HEAD and the server wishes to make 
  1724.    public why the request has not been fulfilled, it should describe 
  1725.    the reason for the refusal in the entity body. This status code is 
  1726.    commonly used when the server does not wish to reveal exactly why 
  1727.    the request has been refused, or when no other response is 
  1728.    applicable.
  1729.  
  1730.    404 Not Found
  1731.  
  1732.    The server has not found anything matching the Request-URI. No 
  1733.    indication is given of whether the condition is temporary or 
  1734.    permanent. If the server does not wish to make this information 
  1735.    available to the client, the status code 403 (forbidden) can be 
  1736.    used instead.
  1737.  
  1738. 9.5  Server Error 5xx
  1739.  
  1740.    Response status codes beginning with the digit "5" indicate cases 
  1741.    in which the server is aware that it has erred or is incapable of 
  1742.    performing the request. If the client has not completed the request 
  1743.    when a 5xx code is received, it should immediately cease sending 
  1744.    data to the server. Except when responding to a HEAD request, the 
  1745.    server should include an entity containing an explanation of the 
  1746.    error situation, and whether it is a temporary or permanent 
  1747.    condition. These response codes are applicable to any request 
  1748.    method and there are no required header fields.
  1749.  
  1750.    500 Internal Server Error
  1751.  
  1752.    The server encountered an unexpected condition which prevented it 
  1753.    from fulfilling the request. 
  1754.  
  1755.    501 Not Implemented
  1756.  
  1757.    The server does not support the functionality required to fulfill 
  1758.    the request. This is the appropriate response when the server does 
  1759.    not recognize the request method and is not capable of supporting 
  1760.    it for any resource.
  1761.  
  1762.    502 Bad Gateway
  1763.  
  1764.    The server, while acting as a gateway or proxy, received an invalid 
  1765.    response from the upstream server it accessed in attempting to 
  1766.    fulfill the request.
  1767.  
  1768.    503 Service Unavailable
  1769.  
  1770.    The server is currently unable to handle the request due to a 
  1771.    temporary overloading or maintenance of the server. The implication 
  1772.    is that this is a temporary condition which will be alleviated 
  1773.    after some delay.
  1774.  
  1775.        Note: The existence of the 503 status code does not imply 
  1776.        that a server must use it when becoming overloaded. Some 
  1777.        servers may wish to simply refuse the connection.
  1778.  
  1779. 10.  Header Field Definitions
  1780.  
  1781.    This section defines the syntax and semantics of all commonly used 
  1782.    HTTP/1.0 header fields. For general and entity header fields, both 
  1783.    sender and recipient refer to either the client or the server, 
  1784.    depending on who sends and who receives the message.
  1785.  
  1786. 10.1  Allow
  1787.  
  1788.    The Allow entity-header field lists the set of methods supported by 
  1789.    the resource identified by the Request-URI. The purpose of this 
  1790.    field is strictly to inform the recipient of valid methods 
  1791.    associated with the resource. The Allow header field is not 
  1792.    permitted in a request using the POST method, and thus should be 
  1793.    ignored if it is received as part of a POST entity.
  1794.  
  1795.        Allow          = "Allow" ":" 1#method
  1796.  
  1797.     Example of use:
  1798.  
  1799.        Allow: GET, HEAD
  1800.  
  1801.    This field cannot prevent a client from trying other methods. 
  1802.    However, the indications given by the Allow header field value 
  1803.    should be followed. The actual set of allowed methods is defined by 
  1804.    the origin server at the time of each request.
  1805.  
  1806.    A proxy must not modify the Allow header field even if it does not 
  1807.    understand all the methods specified, since the user agent may have 
  1808.    other means of communicating with the origin server.
  1809.  
  1810.    The Allow header field does not indicate what methods are 
  1811.    implemented by the server.
  1812.  
  1813. 10.2  Authorization
  1814.  
  1815.    A user agent that wishes to authenticate itself with a 
  1816.    server--usually, but not necessarily, after receiving a 401 
  1817.    response--may do so by including an Authorization request-header 
  1818.    field with the request. The Authorization field value consists of 
  1819.    credentials containing the authentication information of the user 
  1820.    agent for the realm of the resource being requested.
  1821.  
  1822.        Authorization  = "Authorization" ":" credentials
  1823.  
  1824.    HTTP access authentication is described in Section 11. If a request 
  1825.    is authenticated and a realm specified, the same credentials should 
  1826.    be valid for all other requests within this realm.
  1827.  
  1828.    Responses to requests containing an Authorization field are not 
  1829.    cachable.
  1830.  
  1831. 10.3  Content-Encoding
  1832.  
  1833.    The Content-Encoding entity-header field is used as a modifier to 
  1834.    the media-type. When present, its value indicates what additional 
  1835.    content coding has been applied to the resource, and thus what 
  1836.    decoding mechanism must be applied in order to obtain the 
  1837.    media-type referenced by the Content-Type header field. The 
  1838.    Content-Encoding is primarily used to allow a document to be 
  1839.    compressed without losing the identity of its underlying media type.
  1840.  
  1841.        Content-Encoding = "Content-Encoding" ":" content-coding
  1842.  
  1843.    Content codings are defined in Section 3.5. An example of its use is
  1844.  
  1845.        Content-Encoding: x-gzip
  1846.  
  1847.    The Content-Encoding is a characteristic of the resource identified 
  1848.    by the Request-URI. Typically, the resource is stored with this 
  1849.    encoding and is only decoded before rendering or analogous usage.
  1850.  
  1851. 10.4  Content-Length
  1852.  
  1853.    The Content-Length entity-header field indicates the size of the 
  1854.    Entity-Body, in decimal number of octets, sent to the recipient or, 
  1855.    in the case of the HEAD method, the size of the Entity-Body that 
  1856.    would have been sent had the request been a GET.
  1857.  
  1858.        Content-Length = "Content-Length" ":" 1*DIGIT
  1859.  
  1860.    An example is
  1861.  
  1862.        Content-Length: 3495
  1863.  
  1864.    Applications should use this field to indicate the size of the 
  1865.    Entity-Body to be transferred, regardless of the media type of the 
  1866.    entity. A valid Content-Length field value is required on all 
  1867.    HTTP/1.0 request messages containing an entity body.
  1868.  
  1869.    Any Content-Length greater than or equal to zero is a valid value. 
  1870.    Section 7.2.2 describes how to determine the length of a response 
  1871.    entity body if a Content-Length is not given.
  1872.  
  1873.        Note: The meaning of this field is significantly different 
  1874.        from the corresponding definition in MIME, where it is an 
  1875.        optional field used within the "message/external-body" 
  1876.        content-type. In HTTP, it should be used whenever the 
  1877.        entity's length can be determined prior to being transferred.
  1878.  
  1879. 10.5  Content-Type
  1880.  
  1881.    The Content-Type entity-header field indicates the media type of 
  1882.    the Entity-Body sent to the recipient or, in the case of the HEAD 
  1883.    method, the media type that would have been sent had the request 
  1884.    been a GET.
  1885.  
  1886.        Content-Type   = "Content-Type" ":" media-type
  1887.  
  1888.    Media types are defined in Section 3.6. An example of the field is
  1889.  
  1890.        Content-Type: text/html
  1891.  
  1892.    Further discussion of methods for identifying the media type of an 
  1893.    entity is provided in Section 7.2.1.
  1894.  
  1895. 10.6  Date
  1896.  
  1897.    The Date general-header field represents the date and time at which 
  1898.    the message was originated, having the same semantics as orig-date 
  1899.    in RFC 822. The field value is an HTTP-date, as described in 
  1900.    Section 3.3.
  1901.  
  1902.        Date           = "Date" ":" HTTP-date
  1903.  
  1904.    An example is
  1905.  
  1906.        Date: Tue, 15 Nov 1994 08:12:31 GMT
  1907.  
  1908.    If a message is received via direct connection with the user agent 
  1909.    (in the case of requests) or the origin server (in the case of 
  1910.    responses), then the date can be assumed to be the current date at 
  1911.    the receiving end. However, since the date--as it is believed by the 
  1912.    origin--is important for evaluating cached responses, origin servers 
  1913.    should always include a Date header. Clients should only send a 
  1914.    Date header field in messages that include an entity body, as in 
  1915.    the case of the POST request, and even then it is optional. A 
  1916.    received message which does not have a Date header field should be 
  1917.    assigned one by the recipient if the message will be cached by that 
  1918.    recipient or gatewayed via a protocol which requires a Date.
  1919.  
  1920.    In theory, the date should represent the moment just before the 
  1921.    entity is generated. In practice, the date can be generated at any 
  1922.    time during the message origination without affecting its semantic 
  1923.    value.
  1924.  
  1925.        Note: An earlier version of this document incorrectly 
  1926.        specified that this field should contain the creation date 
  1927.        of the enclosed Entity-Body. This has been changed to 
  1928.        reflect actual (and proper) usage.
  1929.  
  1930. 10.7  Expires
  1931.  
  1932.    The Expires entity-header field gives the date/time after which the 
  1933.    entity should be considered stale. This allows information 
  1934.    providers to suggest the volatility of the resource, or a date 
  1935.    after which the information may no longer be valid. Applications 
  1936.    must not cache this entity beyond the date given. The presence of 
  1937.    an Expires field does not imply that the original resource will 
  1938.    change or cease to exist at, before, or after that time. However, 
  1939.    information providers that know or even suspect that a resource 
  1940.    will change by a certain date should include an Expires header with 
  1941.    that date. The format is an absolute date and time as defined by 
  1942.    HTTP-date in Section 3.3.
  1943.  
  1944.        Expires        = "Expires" ":" HTTP-date
  1945.  
  1946.    An example of its use is
  1947.  
  1948.        Expires: Thu, 01 Dec 1994 16:00:00 GMT
  1949.  
  1950.    If the date given is equal to or earlier than the value of the Date 
  1951.    header, the recipient must not cache the enclosed entity. If a 
  1952.    resource is dynamic by nature, as is the case with many 
  1953.    data-producing processes, entities from that resource should be 
  1954.    given an appropriate Expires value which reflects that dynamism.
  1955.  
  1956.    The Expires field cannot be used to force a user agent to refresh 
  1957.    its display or reload a resource; its semantics apply only to 
  1958.    caching mechanisms, and such mechanisms need only check a 
  1959.    resource's expiration status when a new request for that resource 
  1960.    is initiated.
  1961.  
  1962.    User agents often have history mechanisms, such as "Back" buttons 
  1963.    and history lists, which can be used to redisplay an entity 
  1964.    retrieved earlier in a session. By default, the Expires field does 
  1965.    not apply to history mechanisms. If the entity is still in storage, 
  1966.    a history mechanism should display it even if the entity has 
  1967.    expired, unless the user has specifically configured the agent to 
  1968.    refresh expired history documents.
  1969.  
  1970.        Note: Applications are encouraged to be tolerant of bad or 
  1971.        misinformed implementations of the Expires header. A value 
  1972.        of zero (0) or an invalid date format should be considered 
  1973.        equivalent to an "expires immediately." Although these 
  1974.        values are not legitimate for HTTP/1.0, a robust 
  1975.        implementation is always desirable.
  1976.  
  1977. 10.8  From
  1978.  
  1979.    The From request-header field, if given, should contain an Internet 
  1980.    e-mail address for the human user who controls the requesting user 
  1981.    agent. The address should be machine-usable, as defined by mailbox 
  1982.    in RFC 822 [7] (as updated by RFC 1123 [6]):
  1983.  
  1984.        From           = "From" ":" mailbox
  1985.  
  1986.    An example is:
  1987.  
  1988.        From: webmaster@w3.org
  1989.  
  1990.    This header field may be used for logging purposes and as a means 
  1991.    for identifying the source of invalid or unwanted requests. It 
  1992.    should not be used as an insecure form of access protection. The 
  1993.    interpretation of this field is that the request is being performed 
  1994.    on behalf of the person given, who accepts responsibility for the 
  1995.    method performed. In particular, robot agents should include this 
  1996.    header so that the person responsible for running the robot can be 
  1997.    contacted if problems occur on the receiving end.
  1998.  
  1999.    The Internet e-mail address in this field may be separate from the 
  2000.    Internet host which issued the request. For example, when a request 
  2001.    is passed through a proxy, the original issuer's address should be 
  2002.    used.
  2003.  
  2004.        Note: The client should not send the From header field 
  2005.        without the user's approval, as it may conflict with the 
  2006.        user's privacy interests or their site's security policy. It 
  2007.        is strongly recommended that the user be able to disable, 
  2008.        enable, and modify the value of this field at any time prior 
  2009.        to a request.
  2010.  
  2011. 10.9  If-Modified-Since
  2012.  
  2013.    The If-Modified-Since request-header field is used with the GET 
  2014.    method to make it conditional: if the requested resource has not 
  2015.    been modified since the time specified in this field, a copy of the 
  2016.    resource will not be returned from the server; instead, a 304 (not 
  2017.    modified) response will be returned without any Entity-Body.
  2018.  
  2019.        If-Modified-Since = "If-Modified-Since" ":" HTTP-date
  2020.  
  2021.    An example of the field is:
  2022.  
  2023.        If-Modified-Since: Sat, 29 Oct 1994 19:43:31 GMT
  2024.  
  2025.    A conditional GET method requests that the identified resource be 
  2026.    transferred only if it has been modified since the date given by 
  2027.    the If-Modified-Since header. The algorithm for determining this 
  2028.    includes the following cases:
  2029.  
  2030.       a) If the request would normally result in anything other than 
  2031.          a 200 (ok) status, or if the passed If-Modified-Since date 
  2032.          is invalid, the response is exactly the same as for a 
  2033.          normal GET. A date which is later than the server's current 
  2034.          time is invalid.
  2035.  
  2036.       b) If the resource has been modified since the 
  2037.          If-Modified-Since date, the response is exactly the same as 
  2038.          for a normal GET.
  2039.  
  2040.       c) If the resource has not been modified since a valid 
  2041.          If-Modified-Since date, the server shall return a 304 (not 
  2042.          modified) response.
  2043.  
  2044.    The purpose of this feature is to allow efficient updates of cached 
  2045.    information with a minimum amount of transaction overhead.
  2046.  
  2047. 10.10  Last-Modified
  2048.  
  2049.    The Last-Modified entity-header field indicates the date and time 
  2050.    at which the sender believes the resource was last modified. The 
  2051.    exact semantics of this field are defined in terms of how the 
  2052.    recipient should interpret it:  if the recipient has a copy of this 
  2053.    resource which is older than the date given by the Last-Modified 
  2054.    field, that copy should be considered stale.
  2055.  
  2056.        Last-Modified  = "Last-Modified" ":" HTTP-date
  2057.  
  2058.    An example of its use is
  2059.  
  2060.        Last-Modified: Tue, 15 Nov 1994 12:45:26 GMT
  2061.  
  2062.    The exact meaning of this header field depends on the 
  2063.    implementation of the sender and the nature of the original 
  2064.    resource. For files, it may be just the file system last-modified 
  2065.    time. For entities with dynamically included parts, it may be the 
  2066.    most recent of the set of last-modify times for its component 
  2067.    parts. For database gateways, it may be the last-update timestamp 
  2068.    of the record. For virtual objects, it may be the last time the 
  2069.    internal state changed.
  2070.  
  2071.    An origin server must not send a Last-Modified date which is later 
  2072.    than the server's time of message origination. In such cases, where 
  2073.    the resource's last modification would indicate some time in the 
  2074.    future, the server must replace that date with the message 
  2075.    origination date.
  2076.  
  2077. 10.11  Location
  2078.  
  2079.    The Location response-header field defines the exact location of 
  2080.    the resource that was identified by the Request-URI. For 3xx 
  2081.    responses, the location must indicate the server's preferred URL 
  2082.    for automatic redirection to the resource. Only one absolute URL is 
  2083.    allowed.
  2084.  
  2085.        Location       = "Location" ":" absoluteURI
  2086.  
  2087.    An example is
  2088.  
  2089.        Location: http://www.w3.org/hypertext/WWW/NewLocation.html
  2090.  
  2091. 10.12  MIME-Version
  2092.  
  2093.    HTTP is not a MIME-compliant protocol (see Appendix C). However, 
  2094.    HTTP/1.0 messages may include a single MIME-Version general-header 
  2095.    field to indicate what version of the MIME protocol was used to 
  2096.    construct the message. Use of the MIME-Version header field should 
  2097.    indicate that the message is in full compliance with the MIME 
  2098.    protocol (as defined in [5]). Unfortunately, some older versions of 
  2099.    HTTP/1.0 clients and servers use this field indiscriminately, and 
  2100.    thus recipients must not take it for granted that the message is 
  2101.    indeed in full compliance with MIME. Proxies and gateways are 
  2102.    responsible for ensuring this compliance (where possible) when 
  2103.    exporting HTTP messages to strict MIME environments. Future 
  2104.    HTTP/1.0 applications must only use MIME-Version when the message 
  2105.    is fully MIME-compliant.
  2106.  
  2107.        MIME-Version   = "MIME-Version" ":" 1*DIGIT "." 1*DIGIT
  2108.  
  2109.    MIME version "1.0" is the default for use in HTTP/1.0. However, 
  2110.    HTTP/1.0 message parsing and semantics are defined by this document 
  2111.    and not the MIME specification.
  2112.  
  2113. 10.13  Pragma
  2114.  
  2115.    The Pragma general-header field is used to include 
  2116.    implementation-specific directives that may apply to any recipient 
  2117.    along the request/response chain. All pragma directives specify 
  2118.    optional behavior from the viewpoint of the protocol; however, some 
  2119.    systems may require that behavior be consistent with the directives.
  2120.  
  2121.        Pragma           = "Pragma" ":" 1#pragma-directive
  2122.  
  2123.        pragma-directive = "no-cache" | extension-pragma
  2124.        extension-pragma = token [ "=" word ]
  2125.  
  2126.    When the "no-cache" directive is present in a request message, an 
  2127.    application should forward the request toward the origin server 
  2128.    even if it has a cached copy of what is being requested. This 
  2129.    allows a client to insist upon receiving an authoritative response 
  2130.    to its request. It also allows a client to refresh a cached copy 
  2131.    which is known to be corrupted or stale.
  2132.  
  2133.    Pragma directives must be passed through by a proxy or gateway 
  2134.    application, regardless of their significance to that application, 
  2135.    since the directives may be applicable to all recipients along the 
  2136.    request/response chain. It is not possible to specify a pragma for 
  2137.    a specific recipient; however, any pragma directive not relevant to 
  2138.    a recipient should be ignored by that recipient.
  2139.  
  2140. 10.14  Referer
  2141.  
  2142.    The Referer request-header field allows the client to specify, for 
  2143.    the server's benefit, the address (URI) of the resource from which 
  2144.    the Request-URI was obtained. This allows a server to generate 
  2145.    lists of back-links to resources for interest, logging, optimized 
  2146.    caching, etc. It also allows obsolete or mistyped links to be 
  2147.    traced for maintenance. The Referer field must not be sent if the 
  2148.    Request-URI was obtained from a source that does not have its own 
  2149.    URI, such as input from the user keyboard.
  2150.  
  2151.        Referer        = "Referer" ":" ( absoluteURI | relativeURI )
  2152.  
  2153.    Example:
  2154.  
  2155.        Referer: http://www.w3.org/hypertext/DataSources/Overview.html
  2156.  
  2157.    If a partial URI is given, it should be interpreted relative to the 
  2158.    Request-URI. The URI must not include a fragment.
  2159.  
  2160.        Note: Because the source of a link may be private 
  2161.        information or may reveal an otherwise private information 
  2162.        source, it is strongly recommended that the user be able to 
  2163.        select whether or not the Referer field is sent. For 
  2164.        example, a browser client could have a toggle switch for 
  2165.        browsing openly/anonymously, which would respectively 
  2166.        enable/disable the sending of Referer and From information.
  2167.  
  2168. 10.15  Server
  2169.  
  2170.    The Server response-header field contains information about the 
  2171.    software used by the origin server to handle the request. The field 
  2172.    can contain multiple product tokens (Section 3.7) and comments 
  2173.    identifying the server and any significant subproducts. By 
  2174.    convention, the product tokens are listed in order of their 
  2175.    significance for identifying the application.
  2176.  
  2177.        Server         = "Server" ":" 1*( product | comment )
  2178.  
  2179.    Example:
  2180.  
  2181.        Server: CERN/3.0 libwww/2.17
  2182.  
  2183.    If the response is being forwarded through a proxy, the proxy 
  2184.    application must not add its data to the product list.
  2185.  
  2186.        Note: Revealing the specific software version of the server 
  2187.        may allow the server machine to become more vulnerable to 
  2188.        attacks against software that is known to contain security 
  2189.        holes. Server implementors are encouraged to make this field 
  2190.        a configurable option.
  2191.  
  2192. 10.16  User-Agent
  2193.  
  2194.    The User-Agent request-header field contains information about the 
  2195.    user agent originating the request. This is for statistical 
  2196.    purposes, the tracing of protocol violations, and automated 
  2197.    recognition of user agents for the sake of tailoring responses to 
  2198.    avoid particular user agent limitations. Although it is not 
  2199.    required, user agents should include this field with requests. The 
  2200.    field can contain multiple product tokens (Section 3.7) and 
  2201.    comments identifying the agent and any subproducts which form a 
  2202.    significant part of the user agent. By convention, the product 
  2203.    tokens are listed in order of their significance for identifying 
  2204.    the application.
  2205.  
  2206.        User-Agent     = "User-Agent" ":" 1*( product | comment )
  2207.  
  2208.    Example:
  2209.  
  2210.        User-Agent: CERN-LineMode/2.15 libwww/2.17b3
  2211.  
  2212.        Note: Some current proxy applications append their product 
  2213.        information to the list in the User-Agent field. This is not 
  2214.        recommended, since it makes machine interpretation of these 
  2215.        fields ambiguous.
  2216.  
  2217. 10.17  WWW-Authenticate
  2218.  
  2219.    The WWW-Authenticate response-header field must be included in 401 
  2220.    (unauthorized) response messages. The field value consists of at 
  2221.    least one challenge that indicates the authentication scheme(s) and 
  2222.    parameters applicable to the Request-URI.
  2223.  
  2224.        WWW-Authenticate = "WWW-Authenticate" ":" 1#challenge
  2225.  
  2226.    The HTTP access authentication process is described in Section 11. 
  2227.    User agents must take special care in parsing the WWW-Authenticate 
  2228.    field value if it contains more than one challenge, or if more than 
  2229.    one WWW-Authenticate header field is provided, since the contents 
  2230.    of a challenge may itself contain a comma-separated list of 
  2231.    authentication parameters.
  2232.  
  2233. 11.  Access Authentication
  2234.  
  2235.    HTTP provides a simple challenge-response authentication mechanism 
  2236.    which may be used by a server to challenge a client request and by 
  2237.    a client to provide authentication information. It uses an 
  2238.    extensible, case-insensitive token to identify the authentication 
  2239.    scheme, followed by a comma-separated list of attribute-value pairs 
  2240.    which carry the parameters necessary for achieving authentication 
  2241.    via that scheme.
  2242.  
  2243.        auth-scheme    = token
  2244.  
  2245.        auth-param     = token "=" quoted-string
  2246.  
  2247.    The 401 (unauthorized) response message is used by an origin server 
  2248.    to challenge the authorization of a user agent. This response must 
  2249.    include a WWW-Authenticate header field containing at least one 
  2250.    challenge applicable to the requested resource.
  2251.  
  2252.        challenge      = auth-scheme 1*SP realm *( "," auth-param )
  2253.  
  2254.        realm          = "realm" "=" realm-value
  2255.        realm-value    = quoted-string
  2256.  
  2257.    The realm attribute (case-insensitive) is required for all 
  2258.    authentication schemes which issue a challenge. The realm value 
  2259.    (case-sensitive), in combination with the canonical root URL of the 
  2260.    server being accessed, defines the protection space. These realms 
  2261.    allow the protected resources on a server to be partitioned into a 
  2262.    set of protection spaces, each with its own authentication scheme 
  2263.    and/or authorization database. The realm value is a string, 
  2264.    generally assigned by the origin server, which may have additional 
  2265.    semantics specific to the authentication scheme.
  2266.  
  2267.    A user agent that wishes to authenticate itself with a 
  2268.    server--usually, but not necessarily, after receiving a 401 
  2269.    response--may do so by including an Authorization header field with 
  2270.    the request. The Authorization field value consists of credentials 
  2271.    containing the authentication information of the user agent for the 
  2272.    realm of the resource being requested.
  2273.  
  2274.        credentials    = basic-credentials
  2275.                       | ( auth-scheme #auth-param )
  2276.  
  2277.    The domain over which credentials can be automatically applied by a 
  2278.    user agent is determined by the protection space. If a prior 
  2279.    request has been authorized, the same credentials may be reused for 
  2280.    all other requests within that protection space for a period of 
  2281.    time determined by the authentication scheme, parameters, and/or 
  2282.    user preference. Unless otherwise defined by the authentication 
  2283.    scheme, a single protection space cannot extend outside the scope 
  2284.    of its server.
  2285.  
  2286.    If the server does not wish to accept the credentials sent with a 
  2287.    request, it should return a 403 (forbidden) response.
  2288.  
  2289.    The HTTP protocol does not restrict applications to this simple 
  2290.    challenge-response mechanism for access authentication. Additional 
  2291.    mechanisms may be used, such as encryption at the transport level 
  2292.    or via message encapsulation, and with additional header fields 
  2293.    specifying authentication information. However, these additional 
  2294.    mechanisms are not defined by this specification.
  2295.  
  2296.    Proxies must be completely transparent regarding user agent 
  2297.    authentication. That is, they must forward the WWW-Authenticate and 
  2298.    Authorization headers untouched, and must not cache the response to 
  2299.    a request containing Authorization. HTTP/1.0 does not provide a 
  2300.    means for a client to be authenticated with a proxy.
  2301.  
  2302. 11.1  Basic Authentication Scheme
  2303.  
  2304.    The "basic" authentication scheme is based on the model that the 
  2305.    user agent must authenticate itself with a user-ID and a password 
  2306.    for each realm. The realm value should be considered an opaque 
  2307.    string which can only be compared for equality with other realms on 
  2308.    that server. The server will authorize the request only if it can 
  2309.    validate the user-ID and password for the protection space of the 
  2310.    Request-URI. There are no optional authentication parameters.
  2311.  
  2312.    Upon receipt of an unauthorized request for a URI within the 
  2313.    protection space, the server should respond with a challenge like 
  2314.    the following:
  2315.  
  2316.        WWW-Authenticate: Basic realm="WallyWorld"
  2317.  
  2318.    where "WallyWorld" is the string assigned by the server to identify 
  2319.    the protection space of the Request-URI.
  2320.  
  2321.    To receive authorization, the client sends the user-ID and 
  2322.    password, separated by a single colon (":") character, within a 
  2323.    base64 [5] encoded string in the credentials.
  2324.  
  2325.        basic-credentials = "Basic" SP basic-cookie
  2326.  
  2327.        basic-cookie      = <base64 [5] encoding of userid-password,
  2328.                             except not limited to 76 char/line>
  2329.  
  2330.        userid-password   = [ token ] ":" *TEXT
  2331.  
  2332.    If the user agent wishes to send the user-ID "Aladdin" and password 
  2333.    "open sesame", it would use the following header field:
  2334.  
  2335.        Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
  2336.  
  2337.    The basic authentication scheme is a non-secure method of filtering 
  2338.    unauthorized access to resources on an HTTP server. It is based on 
  2339.    the assumption that the connection between the client and the 
  2340.    server can be regarded as a trusted carrier. As this is not 
  2341.    generally true on an open network, the basic authentication scheme 
  2342.    should be used accordingly. In spite of this, clients should 
  2343.    implement the scheme in order to communicate with servers that use 
  2344.    it.
  2345.  
  2346. 12.  Security Considerations
  2347.  
  2348.    This section is meant to inform application developers, information 
  2349.    providers, and users of the security limitations in HTTP/1.0 as 
  2350.    described by this document. The discussion does not include 
  2351.    definitive solutions to the problems revealed, though it does make 
  2352.    some suggestions for reducing security risks.
  2353.  
  2354. 12.1  Authentication of Clients
  2355.  
  2356.    As mentioned in Section 11.1, the Basic authentication scheme is 
  2357.    not a secure method of user authentication, nor does it prevent the 
  2358.    Entity-Body from being transmitted in clear text across the 
  2359.    physical network used as the carrier. HTTP/1.0 does not prevent 
  2360.    additional authentication schemes and encryption mechanisms from 
  2361.    being employed to increase security.
  2362.  
  2363. 12.2  Safe Methods
  2364.  
  2365.    The writers of client software should be aware that the software 
  2366.    represents the user in their interactions over the Internet, and 
  2367.    should be careful to allow the user to be aware of any actions they 
  2368.    may take which may have an unexpected significance to themselves or 
  2369.    others.
  2370.  
  2371.    In particular, the convention has been established that the GET and 
  2372.    HEAD methods should never have the significance of taking an action 
  2373.    other than retrieval. These methods should be considered "safe." 
  2374.    This allows user agents to represent other methods, such as POST, 
  2375.    in a special way, so that the user is made aware of the fact that a 
  2376.    possibly unsafe action is being requested.
  2377.  
  2378.    Naturally, it is not possible to ensure that the server does not 
  2379.    generate side-effects as a result of performing a GET request; in 
  2380.    fact, some dynamic resources consider that a feature. The important 
  2381.    distinction here is that the user did not request the side-effects, 
  2382.    so therefore cannot be held accountable for them.
  2383.  
  2384. 12.3  Abuse of Server Log Information
  2385.  
  2386.    A server is in the position to save personal data about a user's 
  2387.    requests which may identify their reading patterns or subjects of 
  2388.    interest. This information is clearly confidential in nature and 
  2389.    its handling may be constrained by law in certain countries. People 
  2390.    using the HTTP protocol to provide data are responsible for 
  2391.    ensuring that such material is not distributed without the 
  2392.    permission of any individuals that are identifiable by the 
  2393.    published results.
  2394.  
  2395. 12.4  Transfer of Sensitive Information
  2396.  
  2397.    Like any generic data transfer protocol, HTTP cannot regulate the 
  2398.    content of the data that is transferred, nor is there any a priori 
  2399.    method of determining the sensitivity of any particular piece of 
  2400.    information within the context of any given request. Therefore, 
  2401.    applications should supply as much control over this information as 
  2402.    possible to the provider of that information. Three header fields 
  2403.    are worth special mention in this context: Server, Referer and From.
  2404.  
  2405.    Revealing the specific software version of the server may allow the 
  2406.    server machine to become more vulnerable to attacks against 
  2407.    software that is known to contain security holes. Implementors 
  2408.    should make the Server header field a configurable option.
  2409.  
  2410.    The Referer field allows reading patterns to be studied and reverse 
  2411.    links drawn. Although it can be very useful, its power can be 
  2412.    abused if user details are not separated from the information 
  2413.    contained in the Referer. Even when the personal information has 
  2414.    been removed, the Referer field may indicate a private document's 
  2415.    URI whose publication would be inappropriate.
  2416.  
  2417.    The information sent in the From field might conflict with the 
  2418.    user's privacy interests or their site's security policy, and hence 
  2419.    it should not be transmitted without the user being able to 
  2420.    disable, enable, and modify the contents of the field. The user 
  2421.    must be able to set the contents of this field within a user 
  2422.    preference or application defaults configuration.
  2423.  
  2424.    We suggest, though do not require, that a convenient toggle 
  2425.    interface be provided for the user to enable or disable the sending 
  2426.    of From and Referer information.
  2427.  
  2428. 13.  Acknowledgments
  2429.  
  2430.    This specification makes heavy use of the augmented BNF and generic 
  2431.    constructs defined by David H. Crocker for RFC 822 [7]. Similarly, 
  2432.    it reuses many of the definitions provided by Nathaniel Borenstein 
  2433.    and Ned Freed for MIME [5]. We hope that their inclusion in this 
  2434.    specification will help reduce past confusion over the relationship 
  2435.    between HTTP/1.0 and Internet mail message formats.
  2436.  
  2437.    The HTTP protocol has evolved considerably over the past four 
  2438.    years. It has benefited from a large and active developer 
  2439.    community--the many people who have participated on the www-talk 
  2440.    mailing list--and it is that community which has been most 
  2441.    responsible for the success of HTTP and of the World-Wide Web in 
  2442.    general. Marc Andreessen, Robert Cailliau, Daniel W. Connolly,
  2443.    Bob Denny, Jean-Francois Groff, Phillip M. Hallam-Baker,
  2444.    Hakon W. Lie, Ari Luotonen, Rob McCool, Lou Montulli, Dave Raggett,
  2445.    Tony Sanders, and Marc VanHeyningen deserve special recognition for
  2446.    their efforts in defining aspects of the protocol for early versions
  2447.    of this specification.
  2448.  
  2449.    This document has benefited greatly from the comments of all those 
  2450.    participating in the HTTP-WG. In addition to those already 
  2451.    mentioned, the following individuals have contributed to this 
  2452.    specification:
  2453.  
  2454.        Gary Adams                         Harald Tveit Alvestrand
  2455.        Keith Ball                         Brian Behlendorf
  2456.        Paul Burchard                      Maurizio Codogno
  2457.        Mike Cowlishaw                     Roman Czyborra
  2458.        Michael A. Dolan                   John Franks
  2459.        Jim Gettys                         Marc Hedlund
  2460.        Koen Holtman                       Alex Hopmann
  2461.        Bob Jernigan                       Shel Kaphan
  2462.        Martijn Koster                     Dave Kristol
  2463.        Daniel LaLiberte                   Paul Leach
  2464.        Albert Lunde                       John C. Mallery
  2465.        Larry Masinter                     Mitra
  2466.        Gavin Nicol                        Bill Perry
  2467.        Jeffrey Perry                      Owen Rees
  2468.        David Robinson                     Marc Salomon
  2469.        Rich Salz                          Jim Seidman
  2470.        Chuck Shotton                      Eric W. Sink
  2471.        Simon E. Spero                     Robert S. Thau
  2472.        Francois Yergeau                   Mary Ellen Zurko
  2473.        Jean-Philippe Martin-Flatin
  2474.  
  2475. 14. References
  2476.  
  2477.    [1]  F. Anklesaria, M. McCahill, P. Lindner, D. Johnson, D. Torrey, 
  2478.         and B. Alberti. "The Internet Gopher Protocol: A distributed 
  2479.         document search and retrieval protocol." RFC 1436, University 
  2480.         of Minnesota, March 1993.
  2481.  
  2482.    [2]  T. Berners-Lee. "Universal Resource Identifiers in WWW: A 
  2483.         Unifying Syntax for the Expression of Names and Addresses of 
  2484.         Objects on the Network as used in the World-Wide Web." RFC 
  2485.         1630, CERN, June 1994.
  2486.  
  2487.    [3]  T. Berners-Lee and D. Connolly. "HyperText Markup Language 
  2488.         Specification - 2.0." Work in Progress 
  2489.         (draft-ietf-html-spec-05.txt), MIT/W3C, August 1995.
  2490.  
  2491.    [4]  T. Berners-Lee, L. Masinter, and M. McCahill. "Uniform Resource 
  2492.         Locators (URL)." RFC 1738, CERN, Xerox PARC, University of 
  2493.         Minnesota, December 1994.
  2494.  
  2495.    [5]  N. Borenstein and N. Freed. "MIME (Multipurpose Internet Mail 
  2496.         Extensions) Part One: Mechanisms for Specifying and Describing 
  2497.         the Format of Internet Message Bodies." RFC 1521, Bellcore, 
  2498.         Innosoft, September 1993.
  2499.  
  2500.    [6]  R. Braden. "Requirements for Internet hosts - application and 
  2501.         support." STD 3, RFC 1123, IETF, October 1989.
  2502.  
  2503.    [7]  D. H. Crocker. "Standard for the Format of ARPA Internet Text 
  2504.         Messages." STD 11, RFC 822, UDEL, August 1982.
  2505.  
  2506.    [8]  F. Davis, B. Kahle, H. Morris, J. Salem, T. Shen, R. Wang, 
  2507.         J. Sui, and M. Grinbaum. "WAIS Interface Protocol Prototype 
  2508.         Functional Specification." (v1.5), Thinking Machines 
  2509.         Corporation, April 1990.
  2510.  
  2511.    [9]  R. Fielding. "Relative Uniform Resource Locators." RFC 1808, 
  2512.         UC Irvine, June 1995.
  2513.  
  2514.    [10] M. Horton and R. Adams. "Standard for interchange of USENET 
  2515.         messages." RFC 1036 (Obsoletes RFC 850), AT&T Bell 
  2516.         Laboratories, Center for Seismic Studies, December 1987.
  2517.  
  2518.    [11] B. Kantor and P. Lapsley. "Network News Transfer Protocol: 
  2519.         A Proposed Standard for the Stream-Based Transmission of News." 
  2520.         RFC 977, UC San Diego, UC Berkeley, February 1986.
  2521.  
  2522.    [12] J. Postel. "Simple Mail Transfer Protocol." STD 10, RFC 821, 
  2523.         USC/ISI, August 1982.
  2524.  
  2525.    [13] J. Postel. "Media Type Registration Procedure." RFC 1590, 
  2526.         USC/ISI, March 1994.
  2527.  
  2528.    [14] J. Postel and J. K. Reynolds. "File Transfer Protocol (FTP)." 
  2529.         STD 9, RFC 959, USC/ISI, October 1985.
  2530.  
  2531.    [15] J. Reynolds and J. Postel. "Assigned Numbers." STD 2, RFC 1700, 
  2532.         USC/ISI, October 1994.
  2533.  
  2534.    [16] K. Sollins and L. Masinter. "Functional Requirements for 
  2535.         Uniform Resource Names." RFC 1737, MIT/LCS, Xerox Corporation, 
  2536.         December 1994.
  2537.  
  2538.    [17] US-ASCII. Coded Character Set - 7-Bit American Standard Code 
  2539.         for Information Interchange. Standard ANSI X3.4-1986, ANSI, 
  2540.         1986.
  2541.  
  2542.    [18] ISO-8859. International Standard -- Information Processing --
  2543.         8-bit Single-Byte Coded Graphic Character Sets --
  2544.         Part 1: Latin alphabet No. 1, ISO 8859-1:1987.
  2545.         Part 2: Latin alphabet No. 2, ISO 8859-2, 1987.
  2546.         Part 3: Latin alphabet No. 3, ISO 8859-3, 1988.
  2547.         Part 4: Latin alphabet No. 4, ISO 8859-4, 1988.
  2548.         Part 5: Latin/Cyrillic alphabet, ISO 8859-5, 1988.
  2549.         Part 6: Latin/Arabic alphabet, ISO 8859-6, 1987.
  2550.         Part 7: Latin/Greek alphabet, ISO 8859-7, 1987.
  2551.         Part 8: Latin/Hebrew alphabet, ISO 8859-8, 1988.
  2552.         Part 9: Latin alphabet No. 5, ISO 8859-9, 1990.
  2553.  
  2554. 15.  Authors' Addresses
  2555.  
  2556.    Tim Berners-Lee
  2557.    Director, W3 Consortium
  2558.    MIT Laboratory for Computer Science
  2559.    545 Technology Square
  2560.    Cambridge, MA 02139, U.S.A.
  2561.    Tel: +1 (617) 253 5702
  2562.    Fax: +1 (617) 258 8682
  2563.    Email: timbl@w3.org
  2564.  
  2565.    Roy T. Fielding
  2566.    Department of Information and Computer Science
  2567.    University of California
  2568.    Irvine, CA 92717-3425, U.S.A.
  2569.    Tel: +1 (714) 824-4049
  2570.    Fax: +1 (714) 824-4056
  2571.    Email: fielding@ics.uci.edu
  2572.  
  2573.    Henrik Frystyk Nielsen
  2574.    W3 Consortium
  2575.    MIT Laboratory for Computer Science
  2576.    545 Technology Square
  2577.    Cambridge, MA 02139, U.S.A.
  2578.    Tel: +1 (617) 258 8143
  2579.    Fax: +1 (617) 258 8682
  2580.    Email: frystyk@w3.org
  2581.  
  2582. Appendices
  2583.  
  2584.    These appendices are provided for informational reasons only -- they 
  2585.    do not form a part of the HTTP/1.0 specification.
  2586.  
  2587. A.  Internet Media Type message/http
  2588.  
  2589.    In addition to defining the HTTP/1.0 protocol, this document serves 
  2590.    as the specification for the Internet media type "message/http". 
  2591.    The following is to be registered with IANA [13].
  2592.  
  2593.        Media Type name:         message
  2594.  
  2595.        Media subtype name:      http
  2596.  
  2597.        Required parameters:     none
  2598.  
  2599.        Optional parameters:     version, msgtype
  2600.  
  2601.               version: The HTTP-Version number of the enclosed message
  2602.                        (e.g., "1.0"). If not present, the version can be
  2603.                        determined from the first line of the body.
  2604.  
  2605.               msgtype: The message type -- "request" or "response". If 
  2606.                        not present, the type can be determined from the 
  2607.                        first line of the body.
  2608.  
  2609.        Encoding considerations: only "7bit", "8bit", or "binary" are 
  2610.                                 permitted
  2611.  
  2612.        Security considerations: none
  2613.  
  2614. B.  Tolerant Applications
  2615.  
  2616.    Although this document specifies the requirements for the 
  2617.    generation of HTTP/1.0 messages, not all applications will be 
  2618.    correct in their implementation. We therefore recommend that 
  2619.    operational applications be tolerant of deviations whenever those 
  2620.    deviations can be interpreted unambiguously.
  2621.  
  2622.    Clients should be tolerant in parsing the Status-Line and servers 
  2623.    tolerant when parsing the Request-Line. In particular, they should 
  2624.    accept any amount of SP or HT characters between fields, even 
  2625.    though only a single SP is required.
  2626.  
  2627.    The line terminator for HTTP-header fields is the sequence CRLF. 
  2628.    However, we recommend that applications, when parsing such headers, 
  2629.    recognize a single LF as a line terminator and ignore the leading 
  2630.    CR.
  2631.  
  2632. C.  Relationship to MIME
  2633.  
  2634.    HTTP/1.0 reuses many of the constructs defined for Internet Mail 
  2635.    (RFC 822 [7]) and the Multipurpose Internet Mail Extensions 
  2636.    (MIME [5]) to allow entities to be transmitted in an open variety 
  2637.    of representations and with extensible mechanisms. However, HTTP is 
  2638.    not a MIME-compliant application. HTTP's performance requirements 
  2639.    differ substantially from those of Internet mail. Since it is not 
  2640.    limited by the restrictions of existing mail protocols and SMTP 
  2641.    gateways, HTTP does not obey some of the constraints imposed by 
  2642.    RFC 822 and MIME for mail transport.
  2643.  
  2644.    This appendix describes specific areas where HTTP differs from 
  2645.    MIME. Proxies/gateways to MIME-compliant protocols must be aware of 
  2646.    these differences and provide the appropriate conversions where 
  2647.    necessary.
  2648.  
  2649. C.1  Conversion to Canonical Form
  2650.  
  2651.    MIME requires that an entity be converted to canonical form prior 
  2652.    to being transferred, as described in Appendix G of RFC 1521 [5]. 
  2653.    Although HTTP does require media types to be transferred in 
  2654.    canonical form, it changes the definition of "canonical form" for 
  2655.    text-based media types as described in Section 3.6.1.
  2656.  
  2657. C.1.1 Representation of Line Breaks
  2658.  
  2659.    MIME requires that the canonical form of any text type represent 
  2660.    line breaks as CRLF and forbids the use of CR or LF outside of line 
  2661.    break sequences. Since HTTP allows CRLF, bare CR, and bare LF (or 
  2662.    the octet sequence(s) to which they would be translated for the 
  2663.    given character set) to indicate a line break within text content, 
  2664.    recipients of an HTTP message cannot rely upon receiving 
  2665.    MIME-canonical line breaks in text.
  2666.  
  2667.    Where it is possible, a proxy or gateway from HTTP to a 
  2668.    MIME-compliant protocol should translate all line breaks within 
  2669.    text/* media types to the MIME canonical form of CRLF. However, 
  2670.    this may be complicated by the presence of a Content-Encoding and 
  2671.    by the fact that HTTP allows the use of some character sets which 
  2672.    do not use octets 13 and 10 to represent CR and LF, as is the case 
  2673.    for some multi-byte character sets. If canonicalization is 
  2674.    performed, the Content-Length header field value must be updated to 
  2675.    reflect the new body length.
  2676.  
  2677. C.1.2 Default Character Set
  2678.  
  2679.    MIME requires that all subtypes of the top-level Content-Type 
  2680.    "text" have a default character set of US-ASCII [17]. In contrast, 
  2681.    HTTP defines the default character set for "text" to be 
  2682.    ISO-8859-1 [18] (a superset of US-ASCII). Therefore, if a text/* 
  2683.    media type given in the Content-Type header field does not already 
  2684.    include an explicit charset parameter, the parameter
  2685.  
  2686.        ;charset="iso-8859-1"
  2687.  
  2688.    should be added by the proxy/gateway if the entity contains any 
  2689.    octets greater than 127.
  2690.  
  2691. C.2  Conversion of Date Formats
  2692.  
  2693.    HTTP/1.0 uses a restricted subset of date formats to simplify the 
  2694.    process of date comparison. Proxies/gateways from other protocols 
  2695.    should ensure that any Date header field present in a message 
  2696.    conforms to one of the HTTP/1.0 formats and rewrite the date if 
  2697.    necessary.
  2698.  
  2699. C.3  Introduction of Content-Encoding
  2700.  
  2701.    MIME does not include any concept equivalent to HTTP's 
  2702.    Content-Encoding header field. Since this acts as a modifier on the 
  2703.    media type, proxies/gateways to MIME-compliant protocols must 
  2704.    either change the value of the Content-Type header field or decode 
  2705.    the Entity-Body before forwarding the message.
  2706.  
  2707.        Note: Some experimental applications of Content-Type for 
  2708.        Internet mail have used a media-type parameter of 
  2709.        ";conversions=<content-coding>" to perform an equivalent 
  2710.        function as Content-Encoding. However, this parameter is not 
  2711.        part of the MIME specification at the time of this writing.
  2712.  
  2713. C.4  No Content-Transfer-Encoding
  2714.  
  2715.    HTTP does not use the Content-Transfer-Encoding (CTE) field of 
  2716.    MIME. Proxies/gateways from MIME-compliant protocols must remove 
  2717.    any non-identity CTE ("quoted-printable" or "base64") encoding 
  2718.    prior to delivering the response message to an HTTP client. 
  2719.    Proxies/gateways to MIME-compliant protocols are responsible for 
  2720.    ensuring that the message is in the correct format and encoding for 
  2721.    safe transport on that protocol, where "safe transport" is defined 
  2722.    by the limitations of the protocol being used. At a minimum, the 
  2723.    CTE field of
  2724.  
  2725.        Content-Transfer-Encoding: binary
  2726.  
  2727.    should be added by the proxy/gateway if it is unwilling to apply a 
  2728.    content transfer encoding.
  2729.  
  2730.    An HTTP client may include a Content-Transfer-Encoding as an 
  2731.    extension Entity-Header in a POST request when it knows the 
  2732.    destination of that request is a proxy/gateway to a MIME-compliant 
  2733.    protocol.
  2734.