/[suikacvs]/webroot/www/2004/id/draft-ietf-http-v10-spec-01.txt
Suika

Contents of /webroot/www/2004/id/draft-ietf-http-v10-spec-01.txt

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations) (download)
Tue Jun 15 08:04:04 2004 UTC (20 years, 10 months ago) by wakaba
Branch: MAIN
CVS Tags: HEAD
File MIME type: text/plain
New

1 wakaba 1.1 HTTP Working Group T. Berners-Lee, MIT/W3C
2     INTERNET-DRAFT R. Fielding, UC Irvine
3     <draft-ietf-http-v10-spec-01.txt> H. Nielsen, MIT/W3C
4     Expires February 3, 1996 August 3, 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 and negotiation of data
45     representation, allowing systems to be built independently of the
46     data being transferred.
47    
48     HTTP has been in use by the World-Wide Web global information
49     initiative since 1990. This specification reflects preferred usage
50     of the protocol referred to as "HTTP/1.0".
51    
52     Table of Contents
53    
54     1. Introduction
55     1.1 Purpose
56     1.2 Overall Operation
57     1.3 Terminology
58    
59     2. Notational Conventions and Generic Grammar
60     2.1 Augmented BNF
61     2.2 Basic Rules
62    
63     3. Protocol Parameters
64     3.1 HTTP Version
65     3.2 Uniform Resource Identifiers
66     3.2.1 General Syntax
67     3.2.2 http URL
68     3.3 Date/Time Formats
69     3.3.1 Full Date
70     3.3.2 Delta Seconds
71     3.4 Media Types
72     3.4.1 Canonicalization and Text Defaults
73     3.4.2 Multipart Types
74     3.5 Character Set Encodings
75     3.6 Encoding Mechanisms
76     3.7 Transfer Encodings
77     3.8 Language Tags
78     3.9 Quality Values
79     3.10 Product Tokens
80    
81     4. HTTP Message
82     4.1 Message Types
83     4.2 Message Headers
84     4.3 General Message Header Fields
85    
86     5. Request
87     5.1 Request-Line
88     5.2 Method
89     5.2.1 GET
90     5.2.2 HEAD
91     5.2.3 POST
92     5.2.4 PUT
93     5.2.5 DELETE
94     5.2.6 LINK
95     5.2.7 UNLINK
96     5.3 Request-URI
97     5.4 Request Header Fields
98    
99     6. Response
100     6.1 Status-Line
101     6.2 Status Codes and Reason Phrases
102     6.2.1 Informational 1xx
103     6.2.2 Successful 2xx
104     6.2.3 Redirection 3xx
105     6.2.4 Client Error 4xx
106     6.2.5 Server Errors 5xx
107     6.3 Response Header Fields
108    
109     7. Entity
110     7.1 Entity Header Fields
111     7.2 Entity Body
112     7.2.1 Type
113     7.2.2 Length
114    
115     8. Header Field Definitions
116     8.1 Accept
117     8.2 Accept-Charset
118     8.3 Accept-Encoding
119     8.4 Accept-Language
120     8.5 Allow
121     8.6 Authorization
122     8.7 Content-Encoding
123     8.8 Content-Language
124     8.9 Content-Length
125     8.10 Content-Transfer-Encoding
126     8.11 Content-Type
127     8.12 Date
128     8.13 Expires
129     8.14 Forwarded
130     8.15 From
131     8.16 If-Modified-Since
132     8.17 Last-Modified
133     8.18 Link
134     8.19 Location
135     8.20 MIME-Version
136     8.21 Orig-URI
137     8.22 Pragma
138     8.23 Public
139     8.24 Referer
140     8.25 Retry-After
141     8.26 Server
142     8.27 Title
143     8.28 URI
144     8.29 User-Agent
145     8.30 WWW-Authenticate
146    
147     9. Content Negotiation
148    
149     10. Access Authentication
150     10.1 Basic Authentication Scheme
151    
152     11. Security Considerations
153     11.1 Authentication of Clients
154     11.2 Idempotent Methods
155     11.3 Abuse of Server Log Information
156     11.4 Transfer of Sensitive Information
157    
158     12. Acknowledgments
159    
160     13. References
161    
162     14. Authors' Addresses
163    
164     Appendix A. Internet Media Type message/http
165    
166     Appendix B. Tolerant Applications
167    
168     Appendix C. Relationship to MIME
169     C.1 Conversion to Canonical Form
170     C.1.1 Representation of Line Breaks
171     C.1.2 Default Character Set Encoding
172     C.2 Default Content-Transfer-Encoding
173     C.3 Introduction of Content-Encoding
174    
175    
176    
177     1. Introduction
178    
179     1.1 Purpose
180    
181     The Hypertext Transfer Protocol (HTTP) is an application-level
182     protocol with the lightness and speed necessary for distributed,
183     collaborative, hypermedia information systems. HTTP has been in use
184     by the World-Wide Web global information initiative since 1990.
185     This specification reflects preferred usage of the protocol
186     referred to as "HTTP/1.0". This specification does not necessarily
187     reflect the "current practice" of any single HTTP server or client
188     implementation. It does, however, seek to remain compatible with
189     existing implementations wherever possible, and is the reference
190     for future implementations of HTTP/1.0.
191    
192     Practical information systems require more functionality than
193     simple retrieval, including search, front-end update, and
194     annotation. HTTP/1.0 allows an open-ended set of methods to be used
195     to indicate the purpose of a request. It builds on the discipline
196     of reference provided by the Uniform Resource Identifier (URI) [3],
197     as a location (URL) [5] or name (URN) [18], for indicating the
198     resource on which a method is to be applied. Messages are passed in
199     a format similar to that used by Internet Mail [8] and the
200     Multipurpose Internet Mail Extensions (MIME) [6].
201    
202     HTTP/1.0 is also used for communication between user agents and
203     various gateways, allowing hypermedia access to existing Internet
204     protocols like SMTP [14], NNTP [12], FTP [16], Gopher [2], and
205     WAIS [9]. HTTP/1.0 is designed to allow such gateways, via proxy
206     servers, without any loss of the data conveyed by those earlier
207     protocols.
208    
209     1.2 Overall Operation
210    
211     The HTTP protocol is based on a request/response paradigm. A
212     requesting program (termed a client) establishes a connection with
213     a receiving program (termed a server) and sends a request to the
214     server in the form of a request method, URI, and protocol version,
215     followed by a MIME-like message containing request modifiers,
216     client information, and possible body content. The server responds
217     with a status line, including its protocol version and a success or
218     error code, followed by a MIME-like message containing server
219     information, entity metainformation, and possible body content. It
220     should be noted that a given program may be capable of being both a
221     client and a server; our use of those terms refers only to the role
222     being performed by the program during a particular connection,
223     rather than to the program's purpose in general.
224    
225     On the Internet, the communication generally takes place over a
226     TCP/IP connection. The default port is TCP 80 [17], but other ports
227     can be used. This does not preclude the HTTP/1.0 protocol from
228     being implemented on top of any other protocol on the Internet, or
229     on other networks. The mapping of the HTTP/1.0 request and response
230     structures onto the transport data units of the protocol in
231     question is outside the scope of this specification.
232    
233     For most implementations, the connection is established by the
234     client prior to each request and closed by the server after sending
235     the response. However, this is not a feature of the protocol and is
236     not required by this specification. Both clients and servers must
237     be capable of handling cases where either party closes the
238     connection prematurely, due to user action, automated time-out, or
239     program failure. In any case, the closing of the connection by
240     either or both parties always terminates the current request,
241     regardless of its status.
242    
243     1.3 Terminology
244    
245     This specification uses a number of terms to refer to the roles
246     played by participants in, and objects of, the HTTP communication.
247    
248     connection
249    
250     A virtual circuit established between two parties for the
251     purpose of communication.
252    
253     message
254    
255     A structured sequence of octets transmitted via the connection
256     as the basic component of communication.
257    
258     request
259    
260     An HTTP request message (as defined in Section 5).
261    
262     response
263    
264     An HTTP response message (as defined in Section 6).
265    
266     resource
267    
268     A network data object or service which can be identified by a
269     URI.
270    
271     entity
272    
273     A particular representation or rendition of a resource that may
274     be enclosed within a request or response message. An entity
275     consists of metainformation in the form of entity headers and
276     content in the form of an entity body.
277    
278     client
279    
280     A program that establishes connections for the purpose of
281     sending requests.
282    
283     user agent
284    
285     The client program which is closest to the user and which
286     initiates requests at their behest.
287    
288     server
289    
290     A program that accepts connections in order to service requests
291     by sending back responses.
292    
293     origin server
294    
295     The server on which a given resource resides or is to be created.
296    
297     proxy
298    
299     An intermediary program which acts as both a server and a client
300     for the purpose of forwarding requests. Proxies are often used
301     to act as a portal through a network firewall. A proxy server
302     accepts requests from other clients and services them either
303     internally or by passing them, with possible translation, on to
304     other servers. A caching proxy is a proxy server with a local
305     cache of server responses -- some requested resources can be
306     serviced from the cache rather than from the origin server. Some
307     proxy servers also act as origin servers.
308    
309     gateway
310    
311     A proxy which services HTTP requests by translation into
312     protocols other than HTTP. The reply sent from the remote server
313     to the gateway is likewise translated into HTTP before being
314     forwarded to the user agent.
315    
316     2. Notational Conventions and Generic Grammar
317    
318     2.1 Augmented BNF
319    
320     All of the mechanisms specified in this document are described in
321     both prose and an augmented Backus-Naur Form (BNF) similar to that
322     used by RFC 822 [8]. Implementors will need to be familiar with the
323     notation in order to understand this specification. The augmented
324     BNF includes the following constructs:
325    
326     name = definition
327    
328     The name of a rule is simply the name itself (without any
329     enclosing "<" and ">") and is separated from its definition by
330     the equal character "=". Whitespace is only significant in that
331     indentation of continuation lines is used to indicate a rule
332     definition that spans more than one line. Certain basic rules
333     are in uppercase, such as SP, LWS, HT, CRLF, DIGIT, ALPHA, etc.
334     Angle brackets are used within definitions whenever their
335     presence will facilitate discerning the use of rule names.
336    
337     "literal"
338    
339     Quotation marks surround literal text. Unless stated otherwise,
340     the text is case-insensitive.
341    
342     rule1 | rule2
343    
344     Elements separated by a bar ("I") are alternatives,
345     e.g., "yes | no" will accept yes or no.
346    
347     (rule1 rule2)
348    
349     Elements enclosed in parentheses are treated as a single
350     element. Thus, "(elem (foo | bar) elem)" allows the token
351     sequences "elem foo elem" and "elem bar elem".
352    
353     *rule
354    
355     The character "*" preceding an element indicates repetition. The
356     full form is "<n>*<m>element" indicating at least <n> and at
357     most <m> occurrences of element. Default values are 0 and
358     infinity so that "*(element)" allows any number, including zero;
359     "1*element" requires at least one; and "1*2element" allows one
360     or two.
361    
362     [rule]
363    
364     Square brackets enclose optional elements; "[foo bar]" is
365     equivalent to "*1(foo bar)".
366    
367     N rule
368    
369     Specific repetition: "<n>(element)" is equivalent to
370     "<n>*<n>(element)"; that is, exactly <n> occurrences of
371     (element). Thus 2DIGIT is a 2-digit number, and 3ALPHA is a
372     string of three alphabetic characters.
373    
374     #rule
375    
376     A construct "#" is defined, similar to "*", for defining lists
377     of elements. The full form is "<n>#<m>element" indicating at
378     least <n> and at most <m> elements, each separated by one or
379     more commas (",") and optional linear whitespace (LWS). This
380     makes the usual form of lists very easy; a rule such as
381     "( *LWS element *( *LWS "," *LWS element ))" can be shown as
382     "1#element". Wherever this construct is used, null elements are
383     allowed, but do not contribute to the count of elements present.
384     That is, "(element), , (element)" is permitted, but counts as
385     only two elements. Therefore, where at least one element is
386     required, at least one non-null element must be present. Default
387     values are 0 and infinity so that "#(element)" allows any
388     number, including zero; "1#element" requires at least one; and
389     "1#2element" allows one or two.
390    
391     ; comment
392    
393     A semi-colon, set off some distance to the right of rule text,
394     starts a comment that continues to the end of line. This is a
395     simple way of including useful notes in parallel with the
396     specifications.
397    
398     implied *LWS
399    
400     The grammar described by this specification is word-based.
401     Except where noted otherwise, zero or more linear whitespace
402     (LWS) can be included between any two adjacent words (token or
403     quoted-string), and between adjacent tokens and delimiters
404     (tspecials), without changing the interpretation of a field.
405     However, applications should attempt to follow "common form"
406     when generating HTTP constructs, since there exist some
407     implementations that fail to accept anything beyond the common
408     forms.
409    
410     2.2 Basic Rules
411    
412     The following rules are used throughout this specification to
413     describe basic parsing constructs. The US-ASCII character set
414     encoding is defined by [19].
415    
416     OCTET = <any 8-bit sequence of data>
417     CHAR = <any US-ASCII character (octets 0 - 127)>
418     UPALPHA = <any US-ASCII uppercase letter "A".."Z">
419     LOALPHA = <any US-ASCII lowercase letter "a".."z">
420     ALPHA = UPALPHA | LOALPHA
421     DIGIT = <any US-ASCII digit "0".."9">
422     CTL = <any US-ASCII control character
423     (octets 0 - 31) and DEL (127)>
424     CR = <US-ASCII CR, carriage return (13)>
425     LF = <US-ASCII LF, linefeed (10)>
426     SP = <US-ASCII SP, space (32)>
427     HT = <US-ASCII HT, horizontal-tab (9)>
428     <"> = <US-ASCII double-quote mark (34)>
429    
430     HTTP/1.0 defines the octet sequence CR LF as the end-of-line marker
431     for all protocol elements except the Entity-Body (see Appendix B
432     for tolerant applications). The end-of-line marker within an Entity-
433     Body is defined by its associated media type, as described in
434     Section 3.4.
435    
436     CRLF = CR LF
437    
438     HTTP/1.0 headers can be folded onto multiple lines if the
439     continuation lines begin with linear whitespace characters. All
440     linear whitespace, including folding, has the same semantics as SP.
441    
442     LWS = [CRLF] 1*( SP | HT )
443    
444     Many HTTP/1.0 header field values consist of words separated by LWS
445     or special characters. These special characters must be in a quoted
446     string to be used within a parameter value.
447    
448     word = token | quoted-string
449    
450     token = 1*<any CHAR except CTLs or tspecials>
451    
452     tspecials = "(" | ")" | "<" | ">" | "@"
453     | "," | ";" | ":" | "\" | <">
454     | "/" | "[" | "]" | "?" | "="
455     | SP | HT
456    
457     Comments can be included in HTTP header fields by surrounding the
458     comment text with parentheses.
459    
460     comment = "(" *( ctext | comment ) ")"
461     ctext = <any text excluding "(" and ")">
462    
463     Note: Use of comments within HTTP headers is generally
464     discouraged, since they are rarely seen by human eyes and
465     hence only increase network traffic. However, they may be
466     useful for messages posted or retrieved via NNTP and SMTP
467     gateways.
468    
469     A string of text is parsed as a single word if it is quoted using
470     double-quote marks.
471    
472     quoted-string = ( <"> *(qdtext) <"> )
473    
474     qdtext = <any CHAR except <"> and CTLs,
475     but including LWS>
476    
477     The backslash character ("\") may be used as a single-character
478     quoting mechanism only within quoted-string and comment constructs.
479    
480     quoted-pair = "\" CHAR
481    
482     When left unquoted and not within a comment, HTTP uses angle
483     brackets to delimit machine-processable addresses; any LWS inside
484     the angle brackets should be ignored.
485    
486     addr-string = ( "<" *(qatext) ">" )
487    
488     qatext = <any CHAR except "<", ">", and CTLs,
489     but including LWS>
490    
491     The text rule is only used for descriptive field contents and
492     values that are not intended to be interpreted by the message
493     parser. Words of *text may contain octets from character set
494     encodings other than US-ASCII only when encoded according to the
495     rules of RFC 1522 [13].
496    
497     text = <any OCTET except CTLs,
498     but including LWS>
499    
500     Recipients of header field text containing octets outside the
501     US-ASCII character set encoding may assume that they are ISO-8859-1
502     characters if there is no other encoding indicated by an RFC 1522
503     mechanism.
504    
505     3. Protocol Parameters
506    
507     3.1 HTTP Version
508    
509     HTTP uses a "<major>.<minor>" numbering scheme to indicate versions
510     of the protocol. The protocol versioning policy is intended to
511     allow the sender to indicate the format of a message and its
512     capacity for understanding further HTTP communication, rather than
513     the features obtained via that communication. No change is made to
514     the version number for the addition of message components which do
515     not affect communication behavior or which only add to extensible
516     field values. The <minor> number is incremented when the changes
517     made to the protocol add features which do not change the general
518     message parsing algorithm, but which may add to the message
519     semantics and imply additional capabilities of the sender. The
520     <major> number is incremented when the format of a message within
521     the protocol is changed.
522    
523     The version of an HTTP message is indicated by an HTTP-Version
524     field in the first line of the message. If the protocol version is
525     not specified, the recipient must assume that the message is in the
526     simple HTTP/0.9 format.
527    
528     HTTP-Version = "HTTP" "/" 1*DIGIT "." 1*DIGIT
529    
530     Note that the major and minor numbers should be treated as separate
531     integers and that each may be incremented higher than a single
532     digit. Thus, HTTP/2.4 is a lower version than HTTP/2.13, which in
533     turn is lower than HTTP/12.3. Leading zeros should be ignored by
534     recipients and never generated by senders.
535    
536     This document defines both the 0.9 and 1.0 versions of the HTTP
537     protocol. Applications sending Full-Request or Full-Response
538     messages, as defined by this specification, must include an
539     HTTP-Version of "HTTP/1.0".
540    
541     HTTP servers must be able to recognize the format of the
542     Request-Line for all lower-version requests, to understand any
543     valid request in the format of the immediately-prior major version
544     (<major-1>), to understand any valid request in the format of their
545     own native major version (<major>) with the same or lower minor
546     version, and to respond appropriately with a message within the
547     same <major> protocol version used by the client, even when the
548     response is simply an error message.
549    
550     HTTP clients must be able to recognize the format of the
551     Status-Line for all lower-version responses, to understand any
552     valid response in the format of the immediately-prior major version
553     (<major-1>), and to understand any valid response in the format of
554     their own native major version (<major>) with the same or lower
555     minor version. The following hypothetical example illustrates the
556     required behavior.
557    
558     o A valid HTTP/3.5 request is received and the server's native
559     protocol version is
560    
561     o Less than 3.0: it should attempt to understand the request
562     and respond (possibly with an error) in its native format;
563    
564     o Major number of 3: It should understand the request and
565     respond in its native format;
566    
567     o Major number of 4: It should understand the request and
568     respond with a version 3 message;
569    
570     o Major number higher than 4: It should attempt to understand
571     the request and respond (possibly with an error) with a
572     version 3 message;
573    
574     o User agent receives a response to an HTTP/3.5 request, and the
575     response version is
576    
577     o Less than 2.0: It should attempt to understand the response
578     and unobtrusively warn the user of the version mismatch;
579    
580     o 2.0--3.4: It should understand the response and be aware
581     that its request may not have been fully understood by the
582     server;
583    
584     o 3.5 or higher 3: It should understand the response and can
585     assume that the server understood all aspects of the request
586     if the response does not indicate an error;
587    
588     o 4.0 or higher: It should attempt to understand the response
589     and unobtrusively warn the user of the version mismatch.
590    
591     Proxies must be careful in forwarding requests that are received in
592     a format different than that of the proxy's native version. Since
593     the protocol version indicates the protocol capability of the
594     sender, a proxy must never send a message with a version indicator
595     which is greater than its native version; if a higher version
596     request is received, the proxy must either downgrade the request
597     version or respond with an error. Requests with a version lower
598     than that of the proxy's native format may be upgraded by the proxy
599     before being forwarded; the proxy's response to that request must
600     follow the normal server requirements.
601    
602     3.2 Uniform Resource Identifiers
603    
604     URIs have been known by many names: WWW addresses, Universal
605     Document Identifiers, Universal Resource Identifiers [3], and
606     finally the combination of Uniform Resource Locators (URL) [5] and
607     Names (URN) [18]. As far as HTTP is concerned, Uniform Resource
608     Identifiers are simply formatted strings which identify--via name,
609     location, or any other characteristic--a network resource.
610    
611     3.2.1 General Syntax
612    
613     URIs in HTTP/1.0 can be represented in absolute form or relative to
614     some known base URI [10], depending upon the context of their use.
615     The two forms are differentiated by the fact that absolute URIs
616     always begin with a scheme name followed by a colon.
617    
618     URI = ( absoluteURI | relativeURI ) [ "#" fragment ]
619    
620     absoluteURI = scheme ":" *( uchar | reserved )
621    
622     relativeURI = net_path | abs_path | rel_path
623    
624     net_path = "//" net_loc [ abs_path ]
625     abs_path = "/" rel_path
626     rel_path = [ path ] [ ";" params ] [ "?" query ]
627    
628     path = fsegment *( "/" segment )
629     fsegment = 1*pchar
630     segment = *pchar
631    
632     params = param *( ";" param )
633     param = *( pchar | "/" )
634    
635     scheme = 1*( ALPHA | DIGIT | "+" | "-" | "." )
636     net_loc = *( pchar | ";" | "?" )
637     query = *( uchar | reserved )
638     fragment = *( uchar | reserved )
639    
640     pchar = uchar | ":" | "@" | "&" | "="
641     uchar = unreserved | escape
642     unreserved = ALPHA | DIGIT | safe | extra | national
643    
644     escape = "%" hex hex
645     hex = "A" | "B" | "C" | "D" | "E" | "F"
646     | "a" | "b" | "c" | "d" | "e" | "f" | DIGIT
647    
648     reserved = ";" | "/" | "?" | ":" | "@" | "&" | "="
649     safe = "$" | "-" | "_" | "." | "+"
650     extra = "!" | "*" | "'" | "(" | ")" | ","
651     national = <any OCTET excluding CTLs, SP,
652     ALPHA, DIGIT, reserved, safe, and extra>
653    
654     For more information on URL syntax and semantics, see RFC 1738 [5]
655     and RFC 1808 [10]. The BNF above includes characters--all those
656     marked as national--not allowed in valid URLs as specified by RFC
657     1738, since HTTP servers are not restricted in the set of
658     unreserved characters allowed to represent the rel_path part of
659     addresses. In fact, the only real requirement for HTTP is that the
660     URI not contain any LWS; any other invalid URI can be identified
661     and rejected by the server.
662    
663     3.2.2 http URL
664    
665     The "http" scheme is used to locate network resources via the HTTP
666     protocol. This section defines the scheme-specific syntax and
667     semantics for http URLs.
668    
669     http_URL = "http:" "//" host [ ":" port ] abs_path
670    
671     host = <FQDN or IP address, as defined in RFC 1738>
672     port = *DIGIT
673    
674     If the port is empty or not given, port 80 is assumed. The
675     semantics are that the identified resource is located at the server
676     listening for TCP connections on that port of that host, and the
677     Request-URI for the resource is abs_path. If the abs_path is not
678     present in the URL, it must be given as "/" when used as a
679     Request-URI.
680    
681     The canonical form for "http" URLs is obtained by converting any
682     UPALPHA characters in host to their LOALPHA equivalent (hostnames
683     are case-insensitive), eliding the [ ":" port ] if the port is 80,
684     and replacing an empty abs_path with "/".
685    
686     3.3 Date/Time Formats
687    
688     3.3.1 Full Date
689    
690     HTTP/1.0 applications have historically allowed three different
691     formats for the representation of date/time stamps:
692    
693     Sun, 06 Nov 1994 08:49:37 GMT ; RFC 822, updated by RFC 1123
694     Sunday, 06-Nov-94 08:49:37 GMT ; RFC 850, obsoleted by RFC 1036
695     Sun Nov 6 08:49:37 1994 ; ANSI C's asctime() format
696    
697     The first format is preferred as an Internet standard and
698     represents a fixed-length subset of that defined by RFC 1123 [7]
699     (an update to RFC 822 [8]). The second format is in common use, but
700     is based on the obsolete RFC 850 [11] date format and lacks a four-
701     digit year. HTTP/1.0 clients and servers must accept all three
702     formats, though they must never generate the third (asctime)
703     format. Future clients and servers must only generate the RFC 1123
704     format for representing date/time stamps in HTTP/1.0 requests and
705     responses.
706    
707     Note: Recipients of date values are encouraged to be robust
708     in accepting date values that may have been generated by non-
709     HTTP applications, as is sometimes the case when retrieving
710     or posting messages via gateways to SMTP or NNTP.
711    
712     All HTTP/1.0 date/time stamps must be represented in Universal Time
713     (UT), also known as Greenwich Mean Time (GMT), without exception.
714     This is indicated in the first two formats by the inclusion of
715     "GMT" as the three-letter abbreviation for time zone, and should be
716     assumed when reading the asctime format.
717    
718     HTTP-date = rfc1123-date | rfc850-date | asctime-date
719    
720     rfc1123-date = wkday "," SP date1 SP time SP "GMT"
721     rfc850-date = weekday "," SP date2 SP time SP "GMT"
722     asctime-date = wkday SP date3 SP time SP 4DIGIT
723    
724     date1 = 2DIGIT SP month SP 4DIGIT
725     ; day month year (e.g., 02 Jun 1982)
726     date2 = 2DIGIT "-" month "-" 2DIGIT
727     ; day-month-year (e.g., 02-Jun-82)
728     date3 = month SP ( 2DIGIT | ( SP 1DIGIT ))
729     ; month day (e.g., Jun 2)
730    
731     time = 2DIGIT ":" 2DIGIT ":" 2DIGIT
732     ; 00:00:00 - 23:59:59
733    
734     wkday = "Mon" | "Tue" | "Wed"
735     | "Thu" | "Fri" | "Sat" | "Sun"
736    
737     weekday = "Monday" | "Tuesday" | "Wednesday"
738     | "Thursday" | "Friday" | "Saturday" | "Sunday"
739    
740     month = "Jan" | "Feb" | "Mar" | "Apr"
741     | "May" | "Jun" | "Jul" | "Aug"
742     | "Sep" | "Oct" | "Nov" | "Dec"
743    
744     Comments and/or extra LWS are not permitted inside an HTTP-date
745     value generated by a conformant application.
746    
747     Note: HTTP/1.0 requirements for the date/time stamp format
748     apply only to their usage within the protocol stream.
749     Clients and servers are not required to use these formats
750     for user presentation, request logging, etc.
751    
752     3.3.2 Delta Seconds
753    
754     Some HTTP header fields allow a time value to be specified as an
755     integer number of seconds, represented in decimal, after the time
756     that the message was received. This format should only be used to
757     represent short time periods or periods that cannot start until
758     receipt of the message.
759    
760     delta-seconds = 1*DIGIT
761    
762     3.4 Media Types
763    
764     HTTP uses Internet Media Types [15] (formerly referred to as MIME
765     Content-Types [6]) in order to provide open and extensible data
766     typing and type negotiation. For mail applications, where there is
767     no type negotiation between sender and receiver, it is reasonable
768     to put strict limits on the set of allowed media types. With HTTP,
769     however, user agents can identify acceptable media types as part of
770     the connection, and thus are allowed more freedom in the use of non-
771     registered types. The following grammar for media types is a
772     superset of that for MIME because it does not restrict itself to
773     the official IANA and x-token types.
774    
775     media-type = type "/" subtype *( ";" parameter )
776     type = token
777     subtype = token
778    
779     Parameters may follow the type/subtype in the form of
780     attribute/value pairs.
781    
782     parameter = attribute "=" value
783     attribute = token
784     value = token | quoted-string
785    
786     The type, subtype, and parameter attribute names are not case-
787     sensitive. Parameter values may or may not be case-sensitive,
788     depending on the semantics of the parameter name. LWS should not be
789     generated between the type and subtype, nor between an attribute
790     and its value.
791    
792     If a given media-type value has been registered by the IANA, any
793     use of that value must be indicative of the registered data format.
794     Although HTTP allows the use of non-registered media types, such
795     usage must not conflict with the IANA registry. Data providers are
796     strongly encouraged to register their media types with IANA via the
797     procedures outlined in RFC 1590 [15].
798    
799     All media-type's registered by IANA must be preferred over
800     extension tokens. However, HTTP does not limit conforming
801     applications to the use of officially registered media types, nor
802     does it encourage the use of an "x-" prefix for unofficial types
803     outside of explicitly short experimental use between consenting
804     applications.
805    
806     3.4.1 Canonicalization and Text Defaults
807    
808     Media types are registered in a canonical form. In general, entity
809     bodies transferred via HTTP must be represented in the appropriate
810     canonical form prior to transmission. If the body has been encoded
811     via a Content-Encoding and/or Content-Transfer-Encoding, the data
812     must be in canonical form prior to that encoding. However, HTTP
813     modifies the canonical form requirements for media of primary type
814     "text" and for "application" types consisting of text-like records.
815    
816     HTTP redefines the canonical form of text media to allow multiple
817     octet sequences to indicate a text line break. In addition to the
818     preferred form of CRLF, HTTP applications must accept a bare CR or
819     LF alone as representing a single line break in text media.
820     Furthermore, if the text media is represented in a character set
821     encoding which does not use octets 13 and 10 for CR and LF
822     respectively, as is the case for some multi-byte character set
823     encodings, HTTP allows the use of whatever octet sequence(s) is
824     defined by that character set encoding to represent the equivalent
825     of CRLF, bare CR, and bare LF. It is assumed that any recipient
826     capable of using such a character set encoding will know the
827     appropriate octet sequence for representing line breaks within that
828     character set encoding.
829    
830     Note: This interpretation of line breaks applies only to the
831     contents of an Entity-Body and only after any Content-
832     Transfer-Encoding and/or Content-Encoding has been removed.
833     All other HTTP constructs use CRLF exclusively to indicate a
834     line break. Encoding mechanisms define their own line break
835     requirements.
836    
837     A recipient of an HTTP text entity should translate the received
838     entity line breaks to the local line break conventions before
839     saving the entity external to the application and its cache;
840     whether this translation takes place immediately upon receipt of
841     the entity, or only when prompted by the user, is entirely up to
842     the individual application.
843    
844     HTTP also redefines the default character set encoding for text
845     media in an entity body. If a textual media type defines a charset
846     parameter with a registered default value of "US-ASCII", HTTP
847     changes the default to be "ISO-8859-1". Since the ISO-8859-1 [20]
848     character set encoding is a superset of US-ASCII [19], this has no
849     effect upon the interpretation of entity bodies which only contain
850     octets within the US-ASCII set (0 - 127). The presence of a charset
851     parameter value in a Content-Type header field overrides the
852     default.
853    
854     It is recommended but not required that the character set encoding
855     of an entity body be labelled as the lowest common denominator of
856     the character codes used within a document, with the exception that
857     no label is preferred over the labels US-ASCII or ISO-8859-1.
858    
859     3.4.2 Multipart Types
860    
861     MIME provides for a number of "multipart" types -- encapsulations of
862     several entities within a single message's Entity-Body. The
863     multipart types registered by IANA [17] do not have any special
864     meaning for HTTP/1.0, though user agents may need to understand
865     each type in order to correctly interpret the purpose of each body-
866     part. Ideally, an HTTP user agent should follow the same or similar
867     behavior as a MIME user agent does upon receipt of a multipart type.
868    
869     As in MIME [6], all multipart types share a common syntax and must
870     include a boundary parameter as part of the media type value. The
871     message body is itself a protocol element and must therefore use
872     only CRLF to represent line breaks between body-parts. Unlike in
873     MIME, multipart body-parts may contain HTTP header fields which are
874     significant to the meaning of that part.
875    
876     A URI-header field (Section 8.28) should be included in the body-
877     part for each enclosed entity that can be identified by a URI.
878    
879     3.5 Character Set Encodings
880    
881     HTTP uses the same definition of the term "character set" as that
882     described for MIME:
883    
884     The term "character set" is used in this document to
885     refer to a method used with one or more tables to convert
886     a sequence of octets into a sequence of characters. Note
887     that unconditional conversion in the other direction is
888     not required, in that not all characters may be available
889     in a given character set and a character set may provide
890     more than one sequence of octets to represent a
891     particular character. This definition is intended to
892     allow various kinds of character encodings, from simple
893     single-table mappings such as US-ASCII to complex table
894     switching methods such as those that use ISO 2022's
895     techniques. However, the definition associated with a
896     MIME character set name must fully specify the mapping to
897     be performed from octets to characters. In particular,
898     use of external profiling information to determine the
899     exact mapping is not permitted.
900    
901     However, since this is more commonly referred to as a character
902     encoding, this document will refer to them as character set
903     encodings. Character set encodings are identified by case-
904     insensitive tokens. The complete set of tokens are defined by the
905     IANA Character Set registry [17]. However, because that registry
906     does not define a single, consistent token for each character set
907     encoding, we define here the preferred names for those character
908     set encodings most likely to be used with HTTP entities. This set
909     of charset values includes those registered by RFC 1521 [6] -- the
910     US-ASCII [19] and ISO-8859 [20] character set encodings -- and other
911     names specifically recommended for use within MIME charset
912     parameters.
913    
914     charset = "US-ASCII"
915     | "ISO-8859-1" | "ISO-8859-2" | "ISO-8859-3"
916     | "ISO-8859-4" | "ISO-8859-5" | "ISO-8859-6"
917     | "ISO-8859-7" | "ISO-8859-8" | "ISO-8859-9"
918     | "ISO-2022-JP" | "ISO-2022-JP-2" | "ISO-2022-KR"
919     | "UNICODE-1-1" | "UNICODE-1-1-UTF-7" | "UNICODE-1-1-UTF-8"
920     | token
921    
922     Although HTTP allows an arbitrary token to be used as a charset
923     value, any token that has a predefined value within the IANA
924     Character Set registry [17] must represent the character set
925     encoding defined by that registry. Applications are encouraged, but
926     not required, to limit their use of character set encodings to
927     those defined by the IANA registry.
928    
929     3.6 Encoding Mechanisms
930    
931     Encoding mechanism values are used to indicate an encoding
932     transformation that has been or can be applied to a resource.
933     Encoding mechanisms are primarily used to allow a document to be
934     compressed or encrypted without losing the identity of its
935     underlying media type. Typically, the resource is stored in this
936     encoding and only decoded before rendering or analogous usage.
937    
938     encoding-mechanism = "gzip" | "compress" | token
939    
940     Note: For historical reasons, HTTP/1.0 applications should
941     consider "x-gzip" and "x-compress" to be equivalent to
942     "gzip" and "compress", respectively.
943    
944     All encoding-mechanism values are case-insensitive. HTTP/1.0 uses
945     encoding-mechanism values in the Accept-Encoding (Section 8.3) and
946     Content-Encoding (Section 8.7) header fields. Although the value
947     describes the encoding-mechanism, what is more important is that it
948     indicates what decoding mechanism will be required to remove the
949     encoding. Note that a single program may be capable of decoding
950     multiple encoding-mechanism formats. Two values are defined by this
951     specification:
952    
953     gzip An encoding format produced by the file compression
954     program "gzip" (GNU zip) developed by Jean-loup Gailly.
955     This format is typically a Lempel-Ziv coding (LZ77) with
956     a 32 bit CRC. Gzip is available from the GNU project at
957     <URL:ftp://prep.ai.mit.edu/pub/gnu/>.
958    
959     compress The encoding format produced by the file compression
960     program "compress". This format is an adaptive
961     Lempel-Ziv-Welch coding (LZW).
962    
963     Note: Use of program names for the identification of
964     encoding formats is not desirable and should be discouraged
965     for future encodings. Their use here is representative of
966     historical practice, not good design.
967    
968     3.7 Transfer Encodings
969    
970     Transfer encoding values are used to indicate an encoding
971     transformation that has been, can be, or may need to be applied to
972     an Entity-Body in order to ensure safe transport through the
973     network. Current transfer encodings are only used with entities
974     destined for or retrieved from MIME-conformant systems, and thus
975     will rarely occur in an HTTP/1.0 message. This differs from an
976     encoding-mechanism in that the transfer encoding is a property of
977     the message, not of the original resource.
978    
979     transfer-encoding = "binary" | "8bit" | "7bit"
980     | "quoted-printable" | "base64"
981     | token
982    
983     All transfer-encoding values are case-insensitive. HTTP/1.0 may use
984     transfer-encoding values in the Content-Transfer-Encoding
985     (Section 8.10) header field.
986    
987     Note: Transfer encodings were designed for MIME with the
988     assumption of their being used only within the context of
989     Internet mail and SMTP. "Safe transport" has a different
990     focus for an 8bit-clean transfer protocol. In HTTP, the only
991     unsafe characteristic of message bodies is the difficulty in
992     determining the exact body length (Section 7.2.2).
993    
994     The values "7bit", "8bit", and "binary" are used to indicate that
995     no transfer encoding has been performed. Instead, they describe the
996     sort of encoding that might be needed for transmission through an
997     unsafe transport system. Binary indicates that the body may contain
998     any set of octets. 8bit adds the restrictions that CR and LF
999     characters only occur as part of CRLF line separators, all lines
1000     are short (less than 1000 octets), and no NULs (octet 0) are
1001     present. 7bit adds a further restriction that all octets are 7-bit
1002     US-ASCII characters.
1003    
1004     The "quoted-printable" and "base64" values indicate that the
1005     associated encoding (as defined in MIME [6]) has been applied to
1006     the body. These encodings consist entirely of 7-bit US-ASCII
1007     characters.
1008    
1009     3.8 Language Tags
1010    
1011     A language tag identifies a natural language spoken, written, or
1012     otherwise conveyed by human beings for communication of information
1013     to other human beings. Computer languages are explicitly excluded.
1014     The HTTP/1.0 protocol uses language tags within the
1015     Accept-Language, Content-Language, and URI-header fields.
1016    
1017     The syntax and registry of HTTP language tags is the same as that
1018     defined by RFC 1766 [1]. In summary, a language tag is composed of
1019     1 or more parts: A primary language tag and a possibly empty series
1020     of subtags:
1021    
1022     language-tag = primary-tag *( "-" subtag )
1023    
1024     primary-tag = 1*8ALPHA
1025     subtag = 1*8ALPHA
1026    
1027     Whitespace is not allowed within the tag and all tags are not case-
1028     sensitive. The namespace of language tags is administered by the
1029     IANA. Example tags include:
1030    
1031     en, en-US, en-cockney, i-cherokee, x-pig-latin
1032    
1033     where any two-letter primary-tag is an ISO 639 language
1034     abbreviation and any two-letter initial subtag is an ISO 3166
1035     country code.
1036    
1037     In the context of the Accept-Language header (Section 8.4), a
1038     language tag is not to be interpreted as a single token, as per
1039     RFC 1766, but as a hierarchy. A server should consider that it has a
1040     match when a language tag received in an Accept-Language header
1041     matches the initial portion of the language tag of a document. An
1042     exact match should be preferred. This interpretation allows a
1043     browser to send, for example:
1044    
1045     Accept-Language: en-US, en; ql=0.95
1046    
1047     when the intent is to access, in order of preference, documents in
1048     US-English ("en-US"), 'plain' or 'international' English ("en"),
1049     and any other variant of English (initial "en-").
1050    
1051     Note: Using the language tag as a hierarchy does not imply
1052     that all languages with a common prefix will be understood
1053     by those fluent in one or more of those languages; it simply
1054     allows the user to request this commonality when it is true
1055     for that user.
1056    
1057     3.9 Quality Values
1058    
1059     HTTP content negotiation (Section 9) uses short "floating point"
1060     numbers to indicate the relative importance ("weight") of various
1061     negotiable parameters. The calculated weights are normalized to a
1062     real number in the range 0 through 1, where 0 is the minimum and 1
1063     the maximum value. In order to discourage misuse of this feature,
1064     HTTP/1.0 applications must not generate more than three digits
1065     after the decimal point. User configuration of these values should
1066     also be limited in this fashion.
1067    
1068     qvalue = ( "0" [ "." 0*3DIGIT ] )
1069     | ( "." 0*3DIGIT )
1070     | ( "1" [ "." 0*3("0") ] )
1071    
1072     "Quality values" is a slight misnomer, since these values actually
1073     measure relative degradation in perceived quality. Thus, a value of
1074     "0.8" represents a 20% degradation from the optimum rather than a
1075     statement of 80% quality.
1076    
1077     3.10 Product Tokens
1078    
1079     Product tokens are used to allow communicating applications to
1080     identify themselves via a simple product token, with an optional
1081     slash and version designator. Most fields using product tokens also
1082     allow subproducts which form a significant part of the application
1083     to be listed, separated by whitespace. By convention, the products
1084     are listed in order of their significance for identifying the
1085     application.
1086    
1087     product = token ["/" product-version]
1088     product-version = token
1089    
1090     Examples:
1091    
1092     User-Agent: CERN-LineMode/2.15 libwww/2.17b3
1093    
1094     Server: Apache/0.8.4
1095    
1096     Product tokens should be short and to the point -- use of them for
1097     advertizing or other non-essential information is explicitly
1098     forbidden. Although any token character may appear in a product-
1099     version, this token should only be used for a version identifier
1100     (i.e., successive versions of the same product should only differ
1101     in the product-version portion of the product value).
1102    
1103     4. HTTP Message
1104    
1105     4.1 Message Types
1106    
1107     HTTP messages consist of requests from client to server and
1108     responses from server to client.
1109    
1110     HTTP-message = Simple-Request ; HTTP/0.9 messages
1111     | Simple-Response
1112     | Full-Request ; HTTP/1.0 messages
1113     | Full-Response
1114    
1115     Full-Request and Full-Response use the generic message format of
1116     RFC 822 [8] for transferring entities. Both messages may include
1117     optional header fields (a.k.a. "headers") and an entity body. The
1118     entity body is separated from the headers by a null line (i.e., a
1119     line with nothing preceding the CRLF).
1120    
1121     Full-Request = Request-Line ; Section 5.1
1122     *( General-Header ; Section 4.3
1123     | Request-Header ; Section 5.4
1124     | Entity-Header ) ; Section 7.1
1125     CRLF
1126     [ Entity-Body ] ; Section 7.2
1127    
1128     Full-Response = Status-Line ; Section 6.1
1129     *( General-Header ; Section 4.3
1130     | Response-Header ; Section 6.3
1131     | Entity-Header ) ; Section 7.1
1132     CRLF
1133     [ Entity-Body ] ; Section 7.2
1134    
1135     Simple-Request and Simple-Response do not allow the use of any
1136     header information and are limited to a single request method (GET).
1137    
1138     Simple-Request = "GET" SP Request-URI CRLF
1139    
1140     Simple-Response = [ Entity-Body ]
1141    
1142     Use of the Simple-Request format is discouraged because it prevents
1143     the client from using content negotiation and the server from
1144     identifying the media type of the returned entity.
1145    
1146     4.2 Message Headers
1147    
1148     HTTP header fields, which include General-Header (Section 4.3),
1149     Request-Header (Section 5.4), Response-Header (Section 6.3), and
1150     Entity-Header (Section 7.1) fields, follow the same generic format
1151     as that given in Section 3.1 of RFC 822 [8]. Each header field
1152     consists of a name followed by a colon (":") and the field value.
1153     Field names are never case-sensitive. The field value may be
1154     preceded by any amount of LWS, though a single SP is preferred.
1155     Header fields can be extended over multiple lines by preceding each
1156     extra line with at least one LWS.
1157    
1158     HTTP-header = field-name ":" [ field-value ] CRLF
1159    
1160     field-name = 1*<any CHAR, excluding CTLs, SP, and ":">
1161     field-value = *( field-content | comment | LWS )
1162    
1163     field-content = <the OCTETs making up the field-value
1164     and consisting of either *text or combinations
1165     of token, tspecials, and quoted-string>
1166    
1167     The order in which header fields are received is not significant.
1168     However, it is "good practice" to send General-Header fields first,
1169     followed by Request-Header or Response-Header fields prior to the
1170     Entity-Header fields.
1171    
1172     Multiple HTTP-header fields with the same field-name may be present
1173     in a message if and only if the entire field-value for that header
1174     field is defined as a comma-separated list [i.e., #(values)]. It
1175     must be possible to combine the multiple header fields into one
1176     "field-name: field-value" pair, without changing the semantics of
1177     the message, by appending each subsequent field-value to the first,
1178     each separated by a comma.
1179    
1180     4.3 General Message Header Fields
1181    
1182     There are a few header fields which have general applicability for
1183     both request and response messages, but which do not apply to the
1184     communicating parties or the content being transferred. Although
1185     none of the General-Header fields are required, they are all
1186     strongly recommended where their use is appropriate, and should be
1187     understood by all future HTTP/1.0 clients and servers. These
1188     headers apply only to the message being transmitted.
1189    
1190     General-Header = Date ; Section 8.12
1191     | Forwarded ; Section 8.14
1192     | MIME-Version ; Section 8.20
1193     | Pragma ; Section 8.22
1194    
1195     General header field names can be extended only via a change in the
1196     protocol version. Unknown header fields are treated as
1197     Entity-Header fields.
1198    
1199     5. Request
1200    
1201     A request message from a client to a server includes, within the
1202     first line of that message, the method to be applied to the
1203     resource requested, the identifier of the resource, and the
1204     protocol version in use. For backwards compatibility with the more
1205     limited HTTP/0.9 protocol, there are two valid formats for an HTTP
1206     request:
1207    
1208     Request = Simple-Request | Full-Request
1209    
1210     Simple-Request = "GET" SP Request-URI CRLF
1211    
1212     Full-Request = Request-Line ; Section 5.1
1213     *( General-Header ; Section 4.3
1214     | Request-Header ; Section 5.4
1215     | Entity-Header ) ; Section 7.1
1216     CRLF
1217     [ Entity-Body ] ; Section 7.2
1218    
1219     If an HTTP/1.0 server receives a Simple-Request, it must respond
1220     with an HTTP/0.9 Simple-Response. An HTTP/1.0 client capable of
1221     receiving a Full-Response should never generate a Simple-Request.
1222    
1223     5.1 Request-Line
1224    
1225     The Request-Line begins with a method token, followed by the
1226     Request-URI and the protocol version, and ending with CRLF. The
1227     elements are separated by SP characters. No CR or LF are allowed
1228     except in the final CRLF sequence.
1229    
1230     Request-Line = Method SP Request-URI SP HTTP-Version CRLF
1231    
1232     Note that the difference between a Simple-Request and the
1233     Request-Line of a Full-Request is the presence of the HTTP-Version
1234     field and the availability of methods other than "GET".
1235    
1236     5.2 Method
1237    
1238     The Method token indicates the method to be performed on the
1239     resource identified by the Request-URI. The method is case-
1240     sensitive.
1241    
1242     Method = "GET" | "HEAD" | "PUT" | "POST"
1243     | "DELETE" | "LINK" | "UNLINK"
1244     | extension-method
1245    
1246     extension-method = token
1247    
1248     The list of methods acceptable by a specific resource can be
1249     specified in an "Allow" Entity-Header (Section 8.5). However, the
1250     client is always notified through the return code of the response
1251     whether a method is currently allowed on a specific resource, as
1252     this can change dynamically. Servers should return the status code
1253     "405 Method Not Allowed" if the method is known by the server but
1254     not allowed for the requested resource, and "501 Not Implemented"
1255     if the method is unknown or not implemented by the server.
1256    
1257     The methods GET and HEAD must be supported by all general-purpose
1258     servers. Servers which provide Last-Modified dates for resources
1259     must also support the conditional GET method.
1260    
1261     The set of common methods for HTTP/1.0 is described below. Although
1262     this set can be easily expanded, additional methods cannot be
1263     assumed to share the same semantics for separately extended clients
1264     and servers. In order to maintain compatibility, the semantic
1265     definition for extension methods should be registered with the
1266     IANA [17].
1267    
1268     5.2.1 GET
1269    
1270     The GET method means retrieve whatever information (in the form of
1271     an entity) is identified by the Request-URI. If the Request-URI
1272     refers to a data-producing process, it is the produced data which
1273     shall be returned as the entity in the response and not the source
1274     text of the process, unless that text happens to be the output of
1275     the process.
1276    
1277     The semantics of the GET method changes to a "conditional GET" if
1278     the request message includes an If-Modified-Since header field. A
1279     conditional GET method requests that the identified resource be
1280     transferred only if it has been modified since the date given by
1281     the If-Modified-Since header, as described in Section 8.16. The
1282     conditional GET method is intended to reduce network usage by
1283     allowing cached entities to be refreshed without requiring multiple
1284     requests or transferring unnecessary data.
1285    
1286     5.2.2 HEAD
1287    
1288     The HEAD method is identical to GET except that the server must not
1289     return any Entity-Body in the response. The metainformation
1290     contained in the HTTP headers in response to a HEAD request should
1291     be identical to the information sent in response to a GET request.
1292     This method can be used for obtaining metainformation about the
1293     resource identified by the Request-URI without transferring the
1294     Entity-Body itself. This method is often used for testing hypertext
1295     links for validity, accessibility, and recent modification.
1296    
1297     There is no "conditional HEAD" request analogous to the conditional
1298     GET. If an If-Modified-Since header field is included with a HEAD
1299     request, it should be ignored.
1300    
1301     5.2.3 POST
1302    
1303     The POST method is used to request that the destination server
1304     accept the entity enclosed in the request as a new subordinate of
1305     the resource identified by the Request-URI in the Request-Line.
1306     POST is designed to allow a uniform method to cover the following
1307     functions:
1308    
1309     o Annotation of existing resources;
1310    
1311     o Posting a message to a bulletin board, newsgroup, mailing list,
1312     or similar group of articles;
1313    
1314     o Providing a block of data, such as the result of submitting a
1315     form [4], to a data-handling process;
1316    
1317     o Extending a database through an append operation.
1318    
1319     The actual function performed by the POST method is determined by
1320     the server and is usually dependent on the Request-URI. The posted
1321     entity is subordinate to that URI in the same way that a file is
1322     subordinate to a directory containing it, a news article is
1323     subordinate to a newsgroup to which it is posted, or a record is
1324     subordinate to a database.
1325    
1326     The client can suggest a URI for identifying the new resource by
1327     including a URI-header field in the request. However, the server
1328     should treat that URI as advisory and may store the entity under a
1329     different URI or without any URI.
1330    
1331     The client may apply relationships between the new resource and
1332     other existing resources by including Link header fields, as
1333     described in Section 8.18. The server may use the Link information
1334     to perform other operations as a result of the new resource being
1335     added. For example, lists and indexes might be updated. However, no
1336     mandatory operation is imposed on the origin server. The origin
1337     server may also generate its own or additional links to other
1338     resources.
1339    
1340     A successful POST does not require that the entity be created as a
1341     resource on the origin server or made accessible for future
1342     reference. That is, the action performed by the POST method might
1343     not result in a resource that can be identified by a URI. In this
1344     case, either 200 (ok) or 204 (no content) is the appropriate
1345     response status, depending on whether or not the response includes
1346     an entity that describes the result.
1347    
1348     If a resource has been created on the origin server, the response
1349     should be 201 (created) and contain the allocated URI, all
1350     applicable Link header fields, and an entity (preferably of type
1351     "text/html") which describes the status of the request and refers
1352     to the new resource.
1353    
1354     A valid Content-Length is required on all HTTP/1.0 POST requests.
1355     An HTTP/1.0 server should respond with a 400 (bad request) message
1356     if it cannot determine the length of the request message's content.
1357    
1358     5.2.4 PUT
1359    
1360     The PUT method requests that the enclosed entity be stored under
1361     the supplied Request-URI. If the Request-URI refers to an already
1362     existing resource, the enclosed entity should be considered as a
1363     modified version of the one residing on the origin server. If the
1364     Request-URI does not point to an existing resource, and that URI is
1365     capable of being defined as a new resource by the requesting user
1366     agent, the origin server can create the resource with that URI. If
1367     a new resource is created, the origin server must inform the user
1368     agent via the 201 (created) response. If an existing resource is
1369     modified, either the 200 (ok) or 204 (no content) response codes
1370     should be sent to indicate successful completion of the request. If
1371     the resource could not be created or modified with the Request-URI,
1372     an appropriate error response should be given that reflects the
1373     nature of the problem.
1374    
1375     The fundamental difference between the POST and PUT requests is
1376     reflected in the different meaning of the Request-URI. The URI in a
1377     POST request identifies the resource that will handle the enclosed
1378     entity as an appendage. That resource may be a data-accepting
1379     process, a gateway to some other protocol, or a separate entity
1380     that accepts annotations. In contrast, the URI in a PUT request
1381     identifies the entity enclosed with the request -- the user agent
1382     knows what URI is intended and the server must not attempt to apply
1383     the request to some other resource. If the server desires that the
1384     request be applied to a different URI, it must send a 301 (moved
1385     permanently) response; the user agent may then make its own
1386     decision regarding whether or not to redirect the request.
1387    
1388     A single resource may be identified by many different URIs. For
1389     example, an article may have a URI for identifying "the current
1390     version" which is separate from the URI identifying each particular
1391     version. In this case, a PUT request on a general URI may result in
1392     several other URIs being defined by the origin server. The user
1393     agent should be informed of these URIs via one or more URI header
1394     fields in the response. The Location header field should be used to
1395     identify the exact location URI if it is different than the
1396     Request-URI.
1397    
1398     A valid Content-Length is required on all HTTP/1.0 PUT requests. An
1399     HTTP/1.0 server should respond with a 400 (bad request) message if
1400     it cannot determine the length of the request message's content.
1401    
1402     The client can create or modify relationships between the enclosed
1403     entity and other existing resources by including Link header
1404     fields, as described in Section 8.18. As with POST, the server may
1405     use the Link information to perform other operations as a result of
1406     the request. However, no mandatory operation is imposed on the
1407     origin server. The origin server may generate its own or additional
1408     links to other resources.
1409    
1410     The actual method for determining how the resource is placed, and
1411     what happens to its predecessor, is defined entirely by the origin
1412     server. If version control is implemented by the origin server,
1413     then Link relationships should be defined by the server to help
1414     identify and control revisions to a resource; suggested
1415     relationship names include "Derived-From", "Obsoletes", and
1416     "Updates".
1417    
1418     Note: The model of sending an entire PUT request within a
1419     single message, without first checking if the server is
1420     willing to accept that data, will break if the server is
1421     unwilling to accept the request or desires some form of
1422     authentication beforehand. Worse, the client won't be
1423     notified of the reason for error if a TCP reset is received
1424     prior to reading the response buffer (see note in
1425     Section 6.2.4). It should therefore be recognized that
1426     HTTP/1.0 PUT and large POST requests will only work reliably
1427     if the client's intentions and server's desires are
1428     negotiated prior to the request.
1429    
1430     5.2.5 DELETE
1431    
1432     The DELETE method requests that the origin server delete the
1433     resource identified by the Request-URI. This method may be
1434     overridden by human intervention (or other means) on the origin
1435     server. The client cannot be guaranteed that the operation has been
1436     carried out, even if the status code returned from the origin
1437     server indicates that the action has been completed successfully.
1438     However, the server should not indicate success unless, at the time
1439     the response is given, it intends to delete the resource or move it
1440     to an inaccessible location.
1441    
1442     A successful response should be 200 (ok) if the response includes
1443     an entity describing the status, 202 (accepted) if the action has
1444     not yet been enacted, or 204 (no content) if the response is OK but
1445     does not include an entity.
1446    
1447     5.2.6 LINK
1448    
1449     The LINK method establishes one or more Link relationships between
1450     the existing resource identified by the Request-URI and other
1451     existing resources. The difference between LINK and other methods
1452     allowing links to be established between resources is that the LINK
1453     method does not allow any Entity-Body to be sent in the request and
1454     does not result in the creation of new resources.
1455    
1456     5.2.7 UNLINK
1457    
1458     The UNLINK method removes one or more Link relationships from the
1459     existing resource identified by the Request-URI. These
1460     relationships may have been established using the LINK method or by
1461     any other method supporting the Link header. The removal of a link
1462     to a resource does not imply that the resource ceases to exist or
1463     becomes inaccessible for future references.
1464    
1465     5.3 Request-URI
1466    
1467     The Request-URI is a Uniform Resource Identifier (Section 3.2) and
1468     identifies the resource upon which to apply the request.
1469    
1470     Request-URI = "*" | absoluteURI | abs_path
1471    
1472     The three options for Request-URI are dependent on the nature of
1473     the request. The asterisk "*" means that the request does not apply
1474     to a particular resource, but to the server itself, and is only
1475     allowed when the Method used does not necessarily apply to a
1476     resource. Note that this is not the case for any of the methods
1477     defined by this document; however, it may be true of extension
1478     methods. One example would be
1479    
1480     OPTIONS * HTTP/1.0
1481    
1482     The absoluteURI form is only allowed when the request is being made
1483     to a proxy server. The proxy is requested to forward the request
1484     and return the response. If the request is idempotent and a
1485     response is cached, the proxy may return the cached message if it
1486     passes any restrictions in the Pragma and Expires header fields.
1487     Note that the proxy may forward the request on to another proxy or
1488     directly to the origin server specified by the absoluteURI. In
1489     order to avoid request loops, a proxy must be able to recognize all
1490     of its server names, including any aliases, local variations, and
1491     the numeric IP address. An example Request-Line would be:
1492    
1493     GET http://www.w3.org/hypertext/WWW/TheProject.html HTTP/1.0
1494    
1495     The most common form of Request-URI is that used to identify a
1496     resource on an origin server. In this case, only the absolute path
1497     of the URI (abs_path) is transmitted. For example, a client wishing
1498     to retrieve the resource above directly from the origin server
1499     would create a TCP connection to port 80 of the host "www.w3.org"
1500     and send the line:
1501    
1502     GET /hypertext/WWW/TheProject.html HTTP/1.0
1503    
1504     followed by the remainder of the Full-Request. Note that the
1505     absolute path cannot be empty; if none is present in the original
1506     URI, it must be given as "/" (the server root).
1507    
1508     5.4 Request Header Fields
1509    
1510     The request header fields allow the client to pass additional
1511     information about the request, and about the client itself, to the
1512     server. All header fields are optional and conform to the generic
1513     HTTP-header syntax.
1514    
1515     Request-Header = Accept ; Section 8.1
1516     | Accept-Charset ; Section 8.2
1517     | Accept-Encoding ; Section 8.3
1518     | Accept-Language ; Section 8.4
1519     | Authorization ; Section 8.6
1520     | From ; Section 8.15
1521     | If-Modified-Since ; Section 8.16
1522     | Orig-URI ; Section 8.21
1523     | Referer ; Section 8.24
1524     | User-Agent ; Section 8.29
1525    
1526     Request-Header field names can be extended only via a change in the
1527     protocol version. Unknown header fields are treated as
1528     Entity-Header fields.
1529    
1530     6. Response
1531    
1532     After receiving and interpreting a request message, a server
1533     responds in the form of an HTTP response message.
1534    
1535     Response = Simple-Response | Full-Response
1536    
1537     Simple-Response = [ Entity-Body ]
1538    
1539     Full-Response = Status-Line ; Section 6.1
1540     *( General-Header ; Section 4.3
1541     | Response-Header ; Section 6.3
1542     | Entity-Header ) ; Section 7.1
1543     CRLF
1544     [ Entity-Body ] ; Section 7.2
1545    
1546     A Simple-Response should only be sent in response to an HTTP/0.9
1547     Simple-Request or if the server only supports the more limited
1548     HTTP/0.9 protocol. If a client sends an HTTP/1.0 Full-Request and
1549     receives a response that does not begin with a Status-Line, it
1550     should assume that the response is a Simple-Response and parse it
1551     accordingly. Note that the Simple-Response consists only of the
1552     entity body and is terminated by the server closing the connection.
1553    
1554     6.1 Status-Line
1555    
1556     The first line of a Full-Response message is the Status-Line,
1557     consisting of the protocol version followed by a numeric status
1558     code and its associated textual phrase, with each element separated
1559     by SP characters. No CR or LF is allowed except in the final CRLF
1560     sequence.
1561    
1562     Status-Line = HTTP-Version SP Status-Code SP Reason-Phrase CRLF
1563    
1564     Since a status line always begins with the protocol version and
1565     status code
1566    
1567     "HTTP/" 1*DIGIT "." 1*DIGIT SP 3DIGIT SP
1568    
1569     (e.g., "HTTP/1.0 200 "), the presence of that expression is
1570     sufficient to differentiate a Full-Response from a Simple-Response.
1571     Although the Simple-Response format may allow such an expression to
1572     occur at the beginning of an entity body, and thus cause a
1573     misinterpretation of the message if it was given in response to a
1574     Full-Request, most HTTP/0.9 servers are limited to responses of
1575     type "text/html" and therefore never generate such a response.
1576    
1577     6.2 Status Codes and Reason Phrases
1578    
1579     The Status-Code element is a 3-digit integer result code of the
1580     attempt to understand and satisfy the request. The Reason-Phrase is
1581     intended to give a short textual description of the Status-Code.
1582     The Status-Code is intended for use by automata and the
1583     Reason-Phrase is intended for the human user. The client is not
1584     required to examine or display the Reason-Phrase.
1585    
1586     The first digit of the Status-Code defines the class of response.
1587     The last two digits do not have any categorization role. There are
1588     5 values for the first digit:
1589    
1590     o 1xx: Informational - Not used, but reserved for future use
1591    
1592     o 2xx: Success - The action was successfully received,
1593     understood, and accepted.
1594    
1595     o 3xx: Redirection - Further action must be taken in order to
1596     complete the request
1597    
1598     o 4xx: Client Error - The request contains bad syntax or cannot
1599     be fulfilled
1600    
1601     o 5xx: Server Error - The server failed to fulfill an apparently
1602     valid request
1603    
1604     The individual values of the numeric status codes defined for
1605     HTTP/1.0, and an example set of corresponding Reason-Phrase's, are
1606     presented below. The reason phrases listed here are only
1607     recommended -- they may be replaced by local equivalents without
1608     affecting the protocol.
1609    
1610     Status-Code = "200" ; OK
1611     | "201" ; Created
1612     | "202" ; Accepted
1613     | "203" ; Non-Authoritative Information
1614     | "204" ; No Content
1615     | "300" ; Multiple Choices
1616     | "301" ; Moved Permanently
1617     | "302" ; Moved Temporarily
1618     | "303" ; See Other
1619     | "304" ; Not Modified
1620     | "400" ; Bad Request
1621     | "401" ; Unauthorized
1622     | "402" ; Payment Required
1623     | "403" ; Forbidden
1624     | "404" ; Not Found
1625     | "405" ; Method Not Allowed
1626     | "406" ; None Acceptable
1627     | "407" ; Proxy Authentication Required
1628     | "408" ; Request Timeout
1629     | "409" ; Conflict
1630     | "410" ; Gone
1631     | "411" ; Authorization Refused
1632     | "500" ; Internal Server Error
1633     | "501" ; Not Implemented
1634     | "502" ; Bad Gateway
1635     | "503" ; Service Unavailable
1636     | "504" ; Gateway Timeout
1637     | extension-code
1638    
1639     extension-code = 3DIGIT
1640    
1641     Reason-Phrase = *<text, excluding CR, LF>
1642    
1643     HTTP status codes are extensible and should be registered with the
1644     IANA. HTTP applications are not required to understand the meaning
1645     of all registered status codes, though such understanding is
1646     obviously desirable. However, applications must understand the
1647     class of any status code, as indicated by the first digit, and
1648     treat any unknown response as being equivalent to the x00 status
1649     code of that class. For example, if an unknown status code of 421
1650     is received by the client, it can safely assume that there was
1651     something wrong with its request and treat the response as if it
1652     had received a 400 status code. In such cases, user agents are
1653     encouraged to present the entity returned with the response to the
1654     user, since that entity is likely to include human-readable
1655     information which will explain the unusual status.
1656    
1657     Each Status-Code is described below, including a description of
1658     which method(s) it can follow and any metainformation required in
1659     the response.
1660    
1661     6.2.1 Informational 1xx
1662    
1663     This class of status codes indicates a provisional response,
1664     consisting only of the Status-Line and optional headers, and is
1665     terminated by an empty line. HTTP/1.0 does not define any 1xx
1666     status codes and they are not a valid response to a standard
1667     HTTP/1.0 request. However, they may be useful for experimental
1668     applications which are outside the scope of this specification.
1669    
1670     6.2.2 Successful 2xx
1671    
1672     This class of status codes indicates that the client's request was
1673     successfully received, understood, and accepted.
1674    
1675     200 OK
1676    
1677     The request has succeeded. The information returned with the
1678     response is dependent on the method used in the request, as follows:
1679    
1680     GET an entity corresponding to the requested resource is being
1681     sent in the response;
1682    
1683     HEAD the response must only contain the header information and
1684     no Entity-Body;
1685    
1686     POST an entity describing or containing the result of the action;
1687    
1688     PUT, DELETE, LINK, UNLINK
1689     an entity describing the result of the action;
1690    
1691     If the entity corresponds to a resource, the response may include a
1692     Location header field giving the actual location of that specific
1693     resource for later reference.
1694    
1695     201 Created
1696    
1697     The request has been fulfilled and resulted in a new resource being
1698     created. The newly created resource can be referenced by the URI(s)
1699     returned in the URI-header field of the response, with the most
1700     specific URL for the resource given by a Location header field. The
1701     origin server is encouraged, but not obliged, to actually create
1702     the resource before using this Status-Code. If the action cannot be
1703     carried out immediately, or within a clearly defined timeframe, the
1704     server should respond with 202 (accepted) instead.
1705    
1706     Of the methods defined by this specification, only PUT and POST can
1707     create a resource.
1708    
1709     202 Accepted
1710    
1711     The request has been accepted for processing, but the processing
1712     has not been completed. The request may or may not eventually be
1713     acted upon, as it may be disallowed when processing actually takes
1714     place. There is no facility for re-sending a status code from an
1715     asynchronous operation such as this.
1716    
1717     The 202 response is intentionally non-committal. Its purpose is to
1718     allow a server to accept a request for some other process (perhaps
1719     a batch-oriented process that is only run once per day) without
1720     requiring that the user agent's connection to the server persist
1721     until the process is completed. The entity returned with this
1722     response should include an indication of the request's current
1723     status and either a pointer to a status monitor or some estimate of
1724     when the user can expect the request to be fulfilled.
1725    
1726     203 Non-Authoritative Information
1727    
1728     The returned metainformation in the Entity-Header is not the
1729     definitive set as available from the origin server, but is gathered
1730     from a local or a third-party copy. The set presented may be a
1731     subset or superset of the original version. For example, including
1732     local annotation information about the resource may result in a
1733     superset of the metainformation known by the origin server. Use of
1734     this response code is not required and is only appropriate when the
1735     response would otherwise be 200 (ok).
1736    
1737     204 No Content
1738    
1739     The server has fulfilled the request but there is no new
1740     information to send back. If the client is a user agent, it should
1741     not change its document view from that which caused the request to
1742     be generated. This response is primarily intended to allow input
1743     for scripts or other actions to take place without causing a change
1744     to the user agent's active document view. The response may include
1745     new metainformation in the form of entity headers, which should
1746     apply to the document currently in the user agent's active view.
1747    
1748     6.2.3 Redirection 3xx
1749    
1750     This class of status code indicates that further action needs to be
1751     taken by the user agent in order to fulfill the request. The action
1752     required can sometimes be carried out by the user agent without
1753     interaction with the user, but it is strongly recommended that this
1754     only take place if the method used in the request is idempotent
1755     (GET or HEAD). A user agent should never automatically redirect a
1756     request more than 5 times, since such redirections usually indicate
1757     an infinite loop.
1758    
1759     300 Multiple Choices
1760    
1761     The requested resource is available at one or more locations and a
1762     preferred location could not be determined via content negotiation.
1763     Unless it was a HEAD request, the response should include an entity
1764     containing a list of resource characteristics and locations from
1765     which the user or user agent can choose the one most appropriate.
1766     The entity format is specified by the media type given in the
1767     Content-Type header field. Depending upon the format and the
1768     capabilities of the user agent, selection of the most appropriate
1769     choice may be performed automatically. If the server has a
1770     preferred choice, it should include its URL in a Location field;
1771     user agents not capable of complex selection may use the Location
1772     value for automatic redirection.
1773    
1774     301 Moved Permanently
1775    
1776     The requested resource has been assigned a new permanent URI and
1777     any future references to this resource should be done using one of
1778     the returned URIs. Clients with link editing capabilities are
1779     encouraged to automatically relink references to the Request-URI to
1780     one or more of the new references returned by the server, where
1781     possible.
1782    
1783     If the new URI is a single location, its URL must be given by the
1784     Location field in the response. If more than one URI exists for the
1785     resource, the primary URL should be given in the Location field and
1786     the other URIs given in one or more URI-header fields. The Entity-
1787     Body of the response should contain a short hypertext note with a
1788     hyperlink to the new URI(s).
1789    
1790     If the 301 status code is received in response to a request using
1791     the PUT, POST, or DELETE methods, the user agent must not
1792     automatically redirect the request unless it can be confirmed by
1793     the user, since this might change the conditions under which the
1794     request was issued.
1795    
1796     302 Moved Temporarily
1797    
1798     The requested resource resides temporarily under a different URI.
1799     Since the redirection may be altered on occasion, the client should
1800     continue to use the Request-URI for future requests.
1801    
1802     If the new URI is a single location, its URL must be given by the
1803     Location field in the response. If more than one URI exists for the
1804     resource, the primary URL should be given in the Location field and
1805     the other URIs given in one or more URI-header fields. The Entity-
1806     Body of the response should contain a short hypertext note with a
1807     hyperlink to the new URI(s).
1808    
1809     If the 302 status code is received in response to a request using
1810     the PUT, POST, or DELETE methods, the user agent must not
1811     automatically redirect the request unless it can be confirmed by
1812     the user, since this might change the conditions under which the
1813     request was issued.
1814    
1815     303 See Other
1816    
1817     The requested resource resides under a different URI and should be
1818     accessed using a GET method on that resource. This method exists
1819     primarily to allow the output of a POST-activated script to
1820     redirect the user agent to a selected resource. The new resource is
1821     not a replacement reference for the original Request-URI.
1822    
1823     If the new URI is a single location, its URL must be given by the
1824     Location field in the response. If more than one URI exists for the
1825     resource, the primary URL should be given in the Location field and
1826     the other URIs given in one or more URI-header fields. The Entity-
1827     Body of the response should contain a short hypertext note with a
1828     hyperlink to the new URI(s).
1829    
1830     304 Not Modified
1831    
1832     If the client has performed a conditional GET request and access is
1833     allowed, but the document has not been modified since the date and
1834     time specified in the If-Modified-Since field, the server shall
1835     respond with this status code and not send an Entity-Body to the
1836     client. Header fields contained in the response should only include
1837     information which is relevant to cache managers and which may have
1838     changed independently of the entity's Last-Modified date. Examples
1839     of relevant header fields include: Date, Server, and Expires.
1840    
1841     6.2.4 Client Error 4xx
1842    
1843     The 4xx class of status codes is intended for cases in which the
1844     client seems to have erred. If the client has not completed the
1845     request when a 4xx code is received, it should immediately cease
1846     sending data to the server. Except when responding to a HEAD
1847     request, the server is encouraged to include an entity containing
1848     an explanation of the error situation, and whether it is a
1849     temporary or permanent condition. These status codes are applicable
1850     to any request method.
1851    
1852     Note: If the client is sending data, server implementations
1853     on TCP should be careful to ensure that the client
1854     acknowledges receipt of the packet(s) containing the
1855     response prior to closing the input connection. If the
1856     client continues sending data to the server after the close,
1857     the server's controller will send a reset packet to the
1858     client, which may erase the client's unacknowledged input
1859     buffers before they can be read and interpreted by the HTTP
1860     application.
1861    
1862     400 Bad Request
1863    
1864     The request could not be understood by the server due to it having
1865     a malformed syntax. The client is discouraged from repeating the
1866     request without modifications.
1867    
1868     401 Unauthorized
1869    
1870     The request requires user authentication. The response must include
1871     a WWW-Authenticate header field (Section 8.30) containing a
1872     challenge applicable to the requested resource. The client may
1873     repeat the request with a suitable Authorization header field. HTTP
1874     access authentication is explained in Section 10.
1875    
1876     402 Payment Required
1877    
1878     This code is not currently supported, but is reserved for future
1879     use.
1880    
1881     403 Forbidden
1882    
1883     The server understood the request, but is refusing to perform the
1884     request because of an unspecified reason. Authorization will not
1885     help and the request should not be repeated. This status code can
1886     be used if the server does not want to make public why the request
1887     has not been fulfilled.
1888    
1889     404 Not Found
1890    
1891     The server has not found anything matching the Request-URI. No
1892     indication is given of whether the condition is temporary or
1893     permanent. If the server does not wish to make this information
1894     available to the client, the status code 403 (forbidden) can be
1895     used instead. The 410 (gone) status code should be used if the
1896     server knows, through some internally configurable mechanism, that
1897     an old resource is permanently unavailable and has no forwarding
1898     address.
1899    
1900     405 Method Not Allowed
1901    
1902     The method specified in the Request-Line is not allowed for the
1903     resource identified by the Request-URI. The response must include
1904     an Allow header containing a list of valid method's for the
1905     requested resource.
1906    
1907     406 None Acceptable
1908    
1909     The server has found a resource matching the Request-URI, but not
1910     one that satisfies the conditions identified by the Accept and
1911     Accept-Encoding request headers. Unless it was a HEAD request, the
1912     response should include an entity containing a list of resource
1913     characteristics and locations from which the user or user agent can
1914     choose the one most appropriate. The entity format is specified by
1915     the media type given in the Content-Type header field. Depending
1916     upon the format and the capabilities of the user agent, selection
1917     of the most appropriate choice may be performed automatically.
1918    
1919     407 Proxy Authentication Required
1920    
1921     This code is reserved for future use. It is similar to 401
1922     (unauthorized), but indicates that the client must first
1923     authenticate itself with the proxy. HTTP/1.0 does not provide a
1924     means for proxy authentication.
1925    
1926     408 Request Timeout
1927    
1928     The client did not produce a request within the time that the
1929     server was prepared to wait. The client may repeat the request
1930     without modifications at any later time.
1931    
1932     409 Conflict
1933    
1934     The request could not be completed due to a conflict with the
1935     current state of the resource. This code is only allowed in
1936     situations where it is expected that the user may be able to
1937     resolve the conflict and resubmit the request. The response body
1938     should include enough information for the user to recognize the
1939     source of the conflict. Ideally, the response entity would include
1940     enough information for the user or user-agent to fix the problem;
1941     however, that may not be possible and is not required.
1942    
1943     Conflicts are most likely to occur in response to a PUT request. If
1944     versioning is being used and the entity being PUT includes changes
1945     to a resource which conflict with those made by an earlier (third-
1946     party) request, the server may use the 409 response to indicate
1947     that it can't complete the PUT. In this case, the response entity
1948     may contain a list of the differences between the two versions.
1949    
1950     410 Gone
1951    
1952     The requested resource is no longer available at the server and no
1953     forwarding address is known. This condition should be considered
1954     permanent. Clients with link editing capabilities are encouraged to
1955     delete references to the Request-URI after user approval. If the
1956     server does not know, or has no facility to determine, whether or
1957     not the condition is permanent, the status code 404 (not found)
1958     should be used instead.
1959    
1960     The 410 response is primarily intended to assist the task of web
1961     maintenance by notifying the recipient that the resource is
1962     intentionally unavailable and that the server owners desire that
1963     remote links to that resource be removed. Such an event is common
1964     for limited-time, promotional services and for resources belonging
1965     to individuals no longer working at the server's site. It is not
1966     necessary to mark all permanently unavailable resources as "gone"
1967     or to keep the mark for any length of time -- that is left to the
1968     discretion of the server owner.
1969    
1970     411 Authorization Refused
1971    
1972     The request credentials provided by the client were rejected by the
1973     server or insufficient to grant authorization to access the
1974     resource. This is similar to the 403 (forbidden) response, but
1975     allows more information to be provided to the user. The content of
1976     the response should contain a description of the problem and may
1977     suggest corrective action. HTTP access authentication is explained
1978     in Section 10.
1979    
1980     The response must include a WWW-Authenticate header field
1981     (Section 8.30) containing a challenge applicable to the requested
1982     resource. If the challenge is different from that assumed by the
1983     last request, the client may repeat the request with a suitable
1984     Authorization header field after obtaining the user's approval.
1985    
1986     6.2.5 Server Errors 5xx
1987    
1988     Response status codes beginning with the digit "5" indicate cases
1989     in which the server is aware that it has erred or is incapable of
1990     performing the request. If the client has not completed the request
1991     when a 5xx code is received, it should immediately cease sending
1992     data to the server. Except when responding to a HEAD request, the
1993     server is encouraged to include an entity containing an explanation
1994     of the error situation, and whether it is a temporary or permanent
1995     condition. These response codes are applicable to any request
1996     method and there are no required header fields.
1997    
1998     500 Internal Server Error
1999    
2000     The server encountered an unexpected condition which prevented it
2001     from fulfilling the request.
2002    
2003     501 Not Implemented
2004    
2005     The server does not support the functionality required to fulfill
2006     the request. This is the appropriate response when the server does
2007     not recognize the request method and is not capable of supporting
2008     it for any resource.
2009    
2010     502 Bad Gateway
2011    
2012     The server received an invalid response from the gateway or
2013     upstream server it accessed in attempting to fulfill the request.
2014    
2015     503 Service Unavailable
2016    
2017     The server is currently unable to handle the request due to a
2018     temporary overloading or maintenance of the server. The implication
2019     is that this is a temporary condition which will be alleviated
2020     after some delay. If known, the length of the delay may be
2021     indicated in a Retry-After header. If no Retry-After is given, the
2022     client should handle the response as it would for a 500 response.
2023    
2024     Note: The existence of the 503 status code does not imply
2025     that a server must use it when becoming overloaded. Some
2026     servers may wish to simply refuse the connection.
2027    
2028     504 Gateway Timeout
2029    
2030     The server did not receive a timely response from the gateway or
2031     upstream server it accessed in attempting to complete the request.
2032    
2033     6.3 Response Header Fields
2034    
2035     The response header fields allow the server to pass additional
2036     information about the response which cannot be placed in the
2037     Status-Line. These header fields are not intended to give
2038     information about an Entity-Body returned in the response, but
2039     about the server itself.
2040    
2041     Response-Header= Location ; Section 8.19
2042     | Public ; Section 8.23
2043     | Retry-After ; Section 8.25
2044     | Server ; Section 8.26
2045     | WWW-Authenticate ; Section 8.30
2046    
2047     Response-Header field names can be extended only via a change in
2048     the protocol version. Unknown header fields are treated as
2049     Entity-Header fields.
2050    
2051     7. Entity
2052    
2053     Full-Request and Full-Response messages may transfer an entity
2054     within some requests and responses. An entity consists of Entity-
2055     Header fields and (usually) an Entity-Body. In this section, both
2056     sender and recipient refer to either the client or the server,
2057     depending on who sends and who receives the entity.
2058    
2059     7.1 Entity Header Fields
2060    
2061     Entity-Header fields define optional metainformation about the
2062     Entity-Body or, if no body is present, about the resource
2063     identified by the request.
2064    
2065     Entity-Header = Allow ; Section 8.5
2066     | Content-Encoding ; Section 8.7
2067     | Content-Language ; Section 8.8
2068     | Content-Length ; Section 8.9
2069     | Content-Transfer-Encoding ; Section 8.10
2070     | Content-Type ; Section 8.11
2071     | Expires ; Section 8.13
2072     | Last-Modified ; Section 8.17
2073     | Link ; Section 8.18
2074     | Title ; Section 8.27
2075     | URI-header ; Section 8.28
2076     | extension-header
2077    
2078     extension-header=HTTP-header
2079    
2080     The extension-header mechanism allows additional Entity-Header to
2081     be defined without changing the protocol, but these fields cannot
2082     be assumed to be recognizable by the recipient. Unknown header
2083     fields should be ignored by the recipient and forwarded by proxies.
2084    
2085     7.2 Entity Body
2086    
2087     The entity-body (if any) sent with an HTTP/1.0 request or response
2088     is in a format and encoding defined by the Entity-Header fields.
2089    
2090     Entity-Body = *OCTET
2091    
2092     An entity-body is included with a request message only when the
2093     request method calls for one. This specification defines two
2094     request methods, "POST" and "PUT", that allow an entity-body. In
2095     general, the presence of an entity-body in a request is signaled by
2096     the inclusion of a Content-Length and/or Content-Transfer-Encoding
2097     header field in the request message headers. HTTP/1.0 requests
2098     containing content must include a valid Content-Length header field.
2099    
2100     For response messages, whether or not an entity-body is included
2101     with a message is dependent on both the request method and the
2102     response code. All responses to the HEAD request method must not
2103     include a body, even though the presence of content header fields
2104     may lead one to believe they do. The responses 204 (no content) and
2105     304 (not modified) must not include a message body.
2106    
2107     7.2.1 Type
2108    
2109     When an Entity-Body is included with a message, the data type of
2110     that body is determined via the header fields Content-Type,
2111     Content-Encoding, and Content-Transfer-Encoding. These define a
2112     three-layer, ordered encoding model:
2113    
2114     entity-body <-
2115     Content-Transfer-Encoding( Content-Encoding( Content-Type ) )
2116    
2117     The default for both encodings is none (i.e., the identity
2118     function). A Content-Type specifies the media type of the
2119     underlying data. A Content-Encoding may be used to indicate any
2120     additional encoding mechanisms applied to the type, usually for the
2121     purpose of data compression, that is a property of the resource
2122     requested. A Content-Transfer-Encoding may be applied by a
2123     transport agent to ensure safe and proper transfer of the message.
2124     Note that the Content-Transfer-Encoding is a property of the
2125     message, not of the resource.
2126    
2127     The Content-Type header field has no default value. If and only if
2128     the media type is not given by a Content-Type header, as is always
2129     the case for Simple-Response messages, the receiver may attempt to
2130     guess the media type via inspection of its content and/or the name
2131     extension(s) of the URL used to specify the resource. If the media
2132     type remains unknown, the receiver should treat it as type
2133     "application/octet-stream".
2134    
2135     7.2.2 Length
2136    
2137     When an Entity-Body is included with a message, the length of that
2138     body may be determined in one of several ways. If a Content-Length
2139     header field is present, its value in bytes represents the length
2140     of the Entity-Body. Otherwise, the body length is determined by the
2141     Content-Type (for types with an explicit end-of-body delimiter),
2142     the Content-Transfer-Encoding (for packetized encodings), or the
2143     closing of the connection by the server.
2144    
2145     Closing the connection cannot be used to indicate the end of a
2146     request body, since it leaves no possibility for the server to send
2147     back a response. Furthermore, there is no guarantee that an
2148     HTTP/1.0 server will recognize types with an explicit end-of-body
2149     delimiter, and there is no packetized Content-Transfer-Encoding
2150     defined for HTTP/1.0. Therefore, HTTP/1.0 requests containing
2151     content must include a valid Content-Length header field. If a
2152     request contains an entity body and Content-Length is not
2153     specified, and the server does not recognize or cannot calculate
2154     the length from other fields, then the server should send a 400
2155     (bad request) response.
2156    
2157     Note: Some older servers supply an invalid Content-Length
2158     when sending a document that contains server-side includes
2159     dynamically inserted into the data stream. It must be
2160     emphasized that this will not be tolerated by future
2161     versions of HTTP. Unless the client knows that it is
2162     receiving a response from a compliant server, it should not
2163     depend on the Content-Length value being correct.
2164    
2165     8. Header Field Definitions
2166    
2167     This section defines the syntax and semantics of all standard
2168     HTTP/1.0 header fields. For Entity-Header fields, both sender and
2169     recipient refer to either the client or the server, depending on
2170     who sends and who receives the entity.
2171    
2172     8.1 Accept
2173    
2174     The Accept header field can be used to indicate a list of media
2175     ranges which are acceptable as a response to the request. The
2176     asterisk "*" character is used to group media types into ranges,
2177     with "*/*" indicating all media types and "type/*" indicating all
2178     subtypes of that type. The set of ranges given by the client should
2179     represent what types are acceptable given the context of the
2180     request. The Accept field should only be used when the request is
2181     specifically limited to a set of desired types, as in the case of a
2182     request for an in-line image, or to indicate qualitative
2183     preferences for specific media types.
2184    
2185     The field may be folded onto several lines and more than one
2186     occurrence of the field is allowed, with the semantics being the
2187     same as if all the entries had been in one field value.
2188    
2189     Accept = "Accept" ":" #(
2190     media-range
2191     [ ";" "q" "=" qvalue ]
2192     [ ";" "mxb" "=" 1*DIGIT ] )
2193    
2194     media-range = ( "*/*"
2195     | ( type "/" "*" )
2196     | ( type "/" subtype )
2197     ) *( ";" parameter )
2198    
2199     The parameter q is used to indicate the quality factor, which
2200     represents the user's preference for that range of media types. The
2201     parameter mxb gives the maximum acceptable size of the Entity-Body,
2202     in decimal number of octets, for that range of media types.
2203     Section 9 describes the content negotiation algorithm which makes
2204     use of these values. The default values are: q=1 and mxb=undefined
2205     (i.e., infinity).
2206    
2207     The example
2208    
2209     Accept: audio/*; q=0.2, audio/basic
2210    
2211     should be interpreted as "I prefer audio/basic, but send me any
2212     audio type if it is the best available after an 80% mark-down in
2213     quality."
2214    
2215     If no Accept header is present, then it is assumed that the client
2216     accepts all media types with quality factor 1. This is equivalent
2217     to the client sending the following accept header field:
2218    
2219     Accept: */*; q=1
2220    
2221     or
2222    
2223     Accept: */*
2224    
2225     A more elaborate example is
2226    
2227     Accept: text/plain; q=0.5, text/html,
2228     text/x-dvi; q=0.8; mxb=100000, text/x-c
2229    
2230     Verbally, this would be interpreted as "text/html and text/x-c are
2231     the preferred media types, but if they do not exist then send the
2232     Entity-Body in text/x-dvi if the entity is less than 100000 bytes,
2233     otherwise send text/plain."
2234    
2235     Note: In earlier versions of this document, the mxs
2236     parameter defined the maximum acceptable delay in seconds
2237     before the response would arrive. This has been removed as
2238     the server has no means of obtaining a useful reference
2239     value. However, this does not prevent the client from
2240     internally measuring the response time and optimizing the
2241     Accept header field accordingly.
2242    
2243     Media ranges can be overridden by more specific media ranges or
2244     specific media types. If more than one media range applies to a
2245     given type, the most specific reference has precedence. For example,
2246    
2247     Accept: text/*, text/html, text/html;version=2.0, */*
2248    
2249     have the following precedence:
2250    
2251     1) text/html;version=2.0
2252     2) text/html
2253     3) text/*
2254     4) */*
2255    
2256     The quality value associated with a given type is determined by
2257     finding the media range with the highest precedence which matches
2258     that type. For example,
2259    
2260     Accept: text/*;q=0.3, text/html;q=0.7, text/html;version=2.0,
2261     */*;q=0.5
2262    
2263     would cause the following values to be associated:
2264    
2265     text/html;version=2.0 = 1
2266     text/html = 0.7
2267     text/plain = 0.3
2268     image/jpeg = 0.5
2269     text/html;level=3 = 0.7
2270    
2271     It must be emphasized that the Accept field should only be used
2272     when it is necessary to restrict the response media types to a
2273     subset of those possible or when the user has been permitted to
2274     specify qualitative values for ranges of media types. If no quality
2275     factors have been set by the user, and the context of the request
2276     is such that the user agent is capable of saving the entity to a
2277     file if the received media type is unknown, then the only
2278     appropriate value for Accept is "*/*".
2279    
2280     Note: A user agent may be provided with a default set of
2281     quality values for certain media ranges. However, unless the
2282     user agent is a completely closed system which cannot
2283     interact with other rendering agents, this default set
2284     should be configurable by the user.
2285    
2286     8.2 Accept-Charset
2287    
2288     The Accept-Charset request header field can be used to indicate a
2289     list of preferred character set encodings other than the default
2290     US-ASCII and ISO-8859-1. This field allows clients capable of
2291     understanding more comprehensive or special-purpose character set
2292     encodings to signal that capability to a server which is capable of
2293     representing documents in those character set encodings.
2294    
2295     Accept-Charset = "Accept-Charset" ":" #charset
2296    
2297     Character set encoding values are described in Section 3.5. An
2298     example is
2299    
2300     Accept-Charset: iso-8859-5, unicode-1-1
2301    
2302     The value of this field should not include "US-ASCII" or
2303     "ISO-8859-1", since those values are always assumed by default. If
2304     a resource is only available in a character set encoding other than
2305     the defaults, and that character set encoding is not listed in the
2306     Accept-Charset field, it is only acceptable for the server to send
2307     the entity if the character set encoding can be identified by an
2308     appropriate charset parameter on the media type or within the
2309     format of the media type itself.
2310    
2311     Note: User agents are not required to be able to render the
2312     characters associated with the ISO-8859-1 character set
2313     encoding. However, they must be able to interpret their
2314     meaning to whatever extent is required to properly handle
2315     messages in that character set encoding.
2316    
2317     8.3 Accept-Encoding
2318    
2319     The Accept-Encoding request header field is similar to Accept, but
2320     restricts the encoding-mechanism values which are acceptable in the
2321     response.
2322    
2323     Accept-Encoding = "Accept-Encoding" ":"
2324     #( encoding-mechanism )
2325    
2326     An example of its use is
2327    
2328     Accept-Encoding: compress, gzip
2329    
2330     If no Accept-Encoding field is present in a request, the server
2331     should assume that the client will accept any encoding-mechanism.
2332    
2333     8.4 Accept-Language
2334    
2335     The Accept-Language request header field is similar to Accept, but
2336     restricts the set of natural languages that are preferred as a
2337     response to the request.
2338    
2339     Accept-Language = "Accept-Language" ":"
2340     #( language-tag [ ";" "ql" "=" qvalue ] )
2341    
2342     The language-tag is described in Section 3.8. Each language may be
2343     given an associated quality value which represents an estimate of
2344     the user's comprehension of that language. The quality value
2345     defaults to "ql=1" (100% comprehension) for listed languages. This
2346     value may be used in the server's content negotiation algorithm
2347     (Section 9). For example,
2348    
2349     Accept-Language: da, en-gb;ql=0.8, de;ql=0.55
2350    
2351     would mean: "I prefer Danish, but will accept British English (with
2352     80% comprehension) or German (with a 55% comprehension)."
2353    
2354     If the server cannot fulfill the request with one or more of the
2355     languages given, or if the languages only represent a subset of a
2356     multi-linguistic Entity-Body, it is acceptable to serve the request
2357     in an unspecified language. This is equivalent to asssigning a
2358     quality value of "ql=0.001" to any unlisted language.
2359    
2360     If no Accept-Language header is present in the request, the server
2361     should assume that all languages are equally acceptable.
2362    
2363     Note: As intelligibility is highly dependent on the
2364     individual user, it is recommended that client applications
2365     make the choice of linguistic preference available to the
2366     user. If the choice is not made available, then the Accept-
2367     Language header field must not be given in the request.
2368    
2369     8.5 Allow
2370    
2371     The Allow header field lists the set of methods supported by the
2372     resource identified by the Request-URI. The purpose of this field
2373     is strictly to inform the recipient of valid methods associated
2374     with the resource. An Allow header field must be present in a 405
2375     (method not allowed) response. The Allow header field is not
2376     permitted in a request using the POST method, and thus should be
2377     ignored if it is received as part of a POST entity.
2378    
2379     Allow = "Allow" ":" #method
2380    
2381     Example of use:
2382    
2383     Allow: GET, HEAD, PUT
2384    
2385     This field cannot prevent a client from trying other methods.
2386     However, the indications given by the Allow field value should be
2387     followed. This field has no default value; if left undefined, the
2388     set of allowed methods is defined by the origin server at the time
2389     of each request.
2390    
2391     The Allow header field may be provided with a PUT request to
2392     recommend the methods to be supported by the new or modified
2393     resource. The server is not required to support these methods and
2394     should include an Allow header in the response giving the actual
2395     supported methods.
2396    
2397     A proxy must not modify the allow header even if it does not
2398     understand all the methods specified, since the user agent may have
2399     other means of communicating with the origin server.
2400    
2401     The Allow header field does not indicate what methods are
2402     implemented at the server level. Servers must use the Public
2403     response header field (Section 8.23) if they wish to describe what
2404     methods are implemented on the server as a whole.
2405    
2406     8.6 Authorization
2407    
2408     A user agent that wishes to authenticate itself with a server--
2409     usually, but not necessarily, after receiving a 401 or 411 response--
2410     may do so by including an Authorization header field with the
2411     request. The Authorization field value consists of credentials
2412     containing the authentication information of the user agent for the
2413     realm of the resource being requested.
2414    
2415     Authorization = "Authorization" ":" 1#credentials
2416    
2417     HTTP access authentication is described in Section 10. If a request
2418     is authenticated and a realm specified, the same credentials should
2419     be valid for all other requests within this realm, until the server
2420     indicates otherwise with a 411 (authorization refused) response.
2421    
2422     8.7 Content-Encoding
2423    
2424     The Content-Encoding header field is used as a modifier to the
2425     media-type. When present, its value indicates what additional
2426     encoding mechanisms have been applied to the resource, and thus
2427     what decoding mechanisms must be applied in order to obtain the
2428     media-type referenced by the Content-Type header field. The
2429     Content-Encoding is primarily used to allow a document to be
2430     compressed without losing the identity of its underlying media type.
2431    
2432     Content-Encoding = "Content-Encoding" ":" 1#encoding-mechanism
2433    
2434     Encoding mechanisms are defined in Section 3.6. An example of its
2435     use is
2436    
2437     Content-Encoding: gzip
2438    
2439     The Content-Encoding is a characteristic of the resource identified
2440     by the Request-URI. Typically, the resource is stored with this
2441     encoding and is only decoded before rendering or analogous usage.
2442    
2443     If multiple encodings have been applied to a resource, the
2444     encoding-mechanisms must be listed in the order in which they were
2445     applied. Additional information about the encoding parameters may
2446     be provided by other Entity-Header fields not defined by this
2447     specification.
2448    
2449     8.8 Content-Language
2450    
2451     The Content-Language field describes the natural language(s) of the
2452     intended audience for the enclosed entity. Note that this may not
2453     be equivalent to all the languages used within the entity.
2454    
2455     Content-Language = "Content-Language" ":" #language-tag
2456    
2457     Language tags are defined in Section 3.8. The primary purpose of
2458     Content-Language is to allow a selective consumer to identify and
2459     differentiate resources according to the consumer's own preferred
2460     language. Thus, if the body content is intended only for a Danish-
2461     literate audience, the appropriate field is
2462    
2463     Content-Language: dk
2464    
2465     If no Content-Language is specified, the default is that the
2466     content is intended for all language audiences. This may mean that
2467     the sender does not consider it to be specific to any natural
2468     language, or that the sender does not know for which language it is
2469     intended.
2470    
2471     Multiple languages may be listed for content that is intended for
2472     multiple audiences. For example, a rendition of the "Treaty of
2473     Waitangi," presented simultaneously in the original Maori and
2474     English versions, would call for
2475    
2476     Content-Language: mi, en
2477    
2478     However, just because multiple languages are present within an
2479     entity does not mean that it is intended for multiple linguistic
2480     audiences. An example would be a beginner's language primer, such
2481     as "A First Lesson in Latin," which is clearly intended to be used
2482     by an English-literate audience. In this case, the Content-Language
2483     should only include "en".
2484    
2485     Content-Language may be applied to any media type -- it should not
2486     be limited to textual documents.
2487    
2488     8.9 Content-Length
2489    
2490     The Content-Length header field indicates the size of the
2491     Entity-Body, in decimal number of octets, sent to the recipient or,
2492     in the case of the HEAD method, the size of the Entity-Body that
2493     would have been sent had the request been a GET.
2494    
2495     Content-Length = "Content-Length" ":" 1*DIGIT
2496    
2497     An example is
2498    
2499     Content-Length: 3495
2500    
2501     Although it is not required, applications are strongly encouraged
2502     to use this field to indicate the size of the Entity-Body to be
2503     transferred, regardless of the media type of the entity.
2504    
2505     Any Content-Length greater than or equal to zero is a valid value.
2506     Section 7.2.2 describes how to determine the length of an
2507     Entity-Body if a Content-Length is not given.
2508    
2509     Note: The meaning of this field is significantly different
2510     from the corresponding definition in MIME, where it is an
2511     optional field used within the "message/external-body"
2512     content-type. In HTTP, it should be used whenever the
2513     entity's length can be determined prior to being transferred.
2514    
2515     8.10 Content-Transfer-Encoding
2516    
2517     The Content-Transfer-Encoding (CTE) header indicates what (if any)
2518     type of transformation has been applied to the entity in order to
2519     safely transfer it between the sender and the recipient. This
2520     differs from the Content-Encoding in that the CTE is a property of
2521     the message, not of the original resource.
2522    
2523     Content-Transfer-Encoding = "Content-Transfer-Encoding" ":"
2524     transfer-encoding
2525    
2526     Transfer encodings are defined in Section 3.7. Because all HTTP
2527     transactions take place on an 8-bit clean connection, the default
2528     Content-Transfer-Encoding for all messages is binary. However, HTTP
2529     may be used to transfer MIME messages which already have a defined
2530     CTE. An example is:
2531    
2532     Content-Transfer-Encoding: quoted-printable
2533    
2534     Many older HTTP/1.0 applications do not understand the
2535     Content-Transfer-Encoding header. However, since it may appear in
2536     any MIME message (i.e., entities retrieved via a gateway to a MIME-
2537     conformant protocol), future HTTP/1.0 applications must understand
2538     it upon receipt. Gateways are the only HTTP applications that would
2539     generate a CTE.
2540    
2541     8.11 Content-Type
2542    
2543     The Content-Type header field indicates the media type of the
2544     Entity-Body sent to the recipient or, in the case of the HEAD
2545     method, the media type that would have been sent had the request
2546     been a GET.
2547    
2548     Content-Type = "Content-Type" ":" media-type
2549    
2550     Media types are defined in Section 3.4. An example of the field is
2551    
2552     Content-Type: text/html; charset=ISO-8859-4
2553    
2554     The Content-Type header field has no default value. Further
2555     discussion of methods for identifying the media type of an entity
2556     is provided in Section 7.2.1.
2557    
2558     8.12 Date
2559    
2560     The Date header represents the date and time at which the message
2561     was originated, having the same semantics as orig-date in RFC
2562     822.The field value is an HTTP-date, as described in Section 3.3.
2563    
2564     Date = "Date" ":" HTTP-date
2565    
2566     An example is
2567    
2568     Date: Tue, 15 Nov 1994 08:12:31 GMT
2569    
2570     If a message is received via direct connection with the user agent
2571     (in the case of requests) or the origin server (in the case of
2572     responses), then the default date can be assumed to be the current
2573     date at the receiving end. However, since the date--as it is
2574     believed by the origin--is important for evaluating cached
2575     responses, origin servers should always include a Date header.
2576     Clients should only send a Date header field in messages that
2577     include an entity body, as in the case of the PUT and POST
2578     requests, and even then it is optional. A received message which
2579     does not have a Date header field should be assigned one by the
2580     receiver if and only if the message will be cached by that receiver
2581     or gatewayed via a protocol which requires a Date.
2582    
2583     Only one Date header field is allowed per message. In theory, the
2584     date should represent the moment just before the entity is
2585     generated. In practice, the date can be generated at any time
2586     during the message origination without affecting its semantic value.
2587    
2588     Note: An earlier version of this document incorrectly
2589     specified that this field should contain the creation date
2590     of the enclosed Entity-Body. This has been changed to
2591     reflect actual (and proper) usage.
2592    
2593     8.13 Expires
2594    
2595     The Expires field gives the date/time after which the entity should
2596     be considered stale. This allows information providers to suggest
2597     the volatility of the resource. Caching clients, including proxies,
2598     must not cache this copy of the resource beyond the date given,
2599     unless its status has been updated by a later check of the origin
2600     server. The presence of an Expires field does not imply that the
2601     original resource will change or cease to exist at, before, or
2602     after that time. However, information providers that know or even
2603     suspect that a resource will change by a certain date are strongly
2604     encouraged to include an Expires header with that date. The format
2605     is an absolute date and time as defined by HTTP-date in Section 3.3.
2606    
2607     Expires = "Expires" ":" HTTP-date
2608    
2609     An example of its use is
2610    
2611     Expires: Thu, 01 Dec 1994 16:00:00 GMT
2612    
2613     The Expires field has no default value. If the date given is equal
2614     to or earlier than the value of the Date header, the recipient must
2615     not cache the enclosed entity. If a resource is dynamic by nature,
2616     as is the case with many data-producing processes, copies of that
2617     resource should be given an appropriate Expires value which
2618     reflects that dynamism.
2619    
2620     The Expires field cannot be used to force a user agent to refresh
2621     its display or reload a resource; its semantics apply only to
2622     caching mechanisms, and such mechanisms need only check a
2623     resource's expiration status when a new request for that resource
2624     is initiated.
2625    
2626     User agents often have history mechanisms, such as "Back" buttons
2627     and history lists, which can be used to redisplay an entity
2628     retrieved earlier in a session. The Expires field does not apply to
2629     history mechanisms. If the entity is still in storage, a history
2630     mechanism should display it even if the entity has expired.
2631    
2632     Note: Applications are encouraged to be tolerant of bad or
2633     misinformed implementations of the Expires header. In
2634     particular, recipients may wish to recognize a delta-seconds
2635     value (any decimal integer) as representing the number of
2636     seconds after receipt of the message that its contents
2637     should be considered expired. Likewise, a value of zero (0)
2638     or an invalid date format should be considered equivalent to
2639     an "expires immediately." Although these values are not
2640     legitimate for HTTP/1.0, a robust implementation is always
2641     desirable.
2642    
2643     8.14 Forwarded
2644    
2645     The Forwarded header is to be used by proxies to indicate the
2646     intermediate steps between the user agent and the server on
2647     requests, and between the origin server and the client on
2648     responses. It is analogous to the "Received" field of RFC 822 [8]
2649     and is intended to be used for tracing transport problems and
2650     avoiding request loops.
2651    
2652     Forwarded = "Forwarded" ":" #( "by" URI [ "(" product ")" ]
2653     [ "for" FQDN ] )
2654    
2655     FQDN = <Fully-Qualified Domain Name>
2656    
2657     For example, a message could be sent from a client on
2658     ptsun00.cern.ch to a server at www.ics.uci.edu port 80, via an
2659     intermediate HTTP proxy at info.cern.ch port 8000. The request
2660     received by the server at www.ics.uci.edu would then have the
2661     following Forwarded header field:
2662    
2663     Forwarded: by http://info.cern.ch:8000/ for ptsun00.cern.ch
2664    
2665     Multiple Forwarded header fields are allowed and should represent
2666     each proxy that has forwarded the message. It is strongly
2667     recommended that proxies used as a portal through a network
2668     firewall do not, by default, send out information about the
2669     internal hosts within the firewall region. This information should
2670     only be propagated if explicitly enabled. If not enabled, the for
2671     token and FQDN should not be included in the field value, and any
2672     Forwarded headers already present in the message (those added
2673     behind the firewall) should be removed.
2674    
2675     8.15 From
2676    
2677     The From header field, if given, should contain an Internet e-mail
2678     address for the human user who controls the requesting user agent.
2679     The address should be machine-usable, as defined by mailbox in RFC
2680     822 [8] (as updated by RFC 1123 [7]):
2681    
2682     From = "From" ":" mailbox
2683    
2684     An example is:
2685    
2686     From: webmaster@w3.org
2687    
2688     This header field may be used for logging purposes and as a means
2689     for identifying the source of invalid or unwanted requests. It
2690     should not be used as an insecure form of access protection. The
2691     interpretation of this field is that the request is being performed
2692     on behalf of the person given, who accepts responsibility for the
2693     method performed. In particular, robot agents should include this
2694     header so that the person responsible for running the robot can be
2695     contacted if problems occur on the receiving end.
2696    
2697     The Internet e-mail address in this field does not have to
2698     correspond to the Internet host which issued the request. For
2699     example, when a request is passed through a proxy the original
2700     issuer's address should be used.
2701    
2702     Note: The client should not send the From header field
2703     without the user's approval, as it may conflict with the
2704     user's privacy interests or their site's security policy. It
2705     is strongly recommended that the user be able to disable,
2706     enable, and modify the value of this field at any time prior
2707     to a request.
2708    
2709     8.16 If-Modified-Since
2710    
2711     The If-Modified-Since header field is used with the GET method to
2712     make it conditional: if the requested resource has not been
2713     modified since the time specified in this field, a copy of the
2714     resource will not be returned from the server; instead, a
2715     "304 Not Modified" response will be returned without any
2716     Entity-Body.
2717    
2718     If-Modified-Since = "If-Modified-Since" ":" HTTP-date
2719    
2720     An example of the field is:
2721    
2722     If-Modified-Since: Sat, 29 Oct 1994 19:43:31 GMT
2723    
2724     A conditional GET method requests that the identified resource be
2725     transferred only if it has been modified since the date given by
2726     the If-Modified-Since header. The algorithm for determining this
2727     includes the following cases:
2728    
2729     a) If the request would normally result in anything other than
2730     a "200 OK" status, or if the passed If-Modified-Since date
2731     is invalid, the response is exactly the same as for a
2732     normal GET.
2733    
2734     b) If the resource has been modified since the If-Modified-
2735     Since date, the response is exactly the same as for a
2736     normal GET.
2737    
2738     c) If the resource has not been modified since the If-Modified-
2739     Since date, the server shall return a "304 Not Modified"
2740     response.
2741    
2742     The purpose of this feature is to allow efficient updates of cached
2743     information with a minimum amount of transaction overhead.
2744    
2745     Note: The same functionality can be obtained, though with
2746     much greater overhead, by issuing a HEAD request and
2747     following it with a GET request if the server indicates that
2748     the entity has been modified.
2749    
2750     8.17 Last-Modified
2751    
2752     The Last-Modified header field indicates the date and time at which
2753     the sender believes the resource was last modified. The exact
2754     semantics of this field are defined in terms of how the receiver
2755     should interpret it: if the receiver has a copy of this resource
2756     which is older than the date given by the Last-Modified field, that
2757     copy should be considered stale.
2758    
2759     Last-Modified = "Last-Modified" ":" HTTP-date
2760    
2761     An example of its use is
2762    
2763     Last-Modified: Tue, 15 Nov 1994 12:45:26 GMT
2764    
2765     The exact meaning of this header field depends on the
2766     implementation of the sender and the nature of the original
2767     resource. For files, it may be just the file system last-mod date.
2768     For entities with dynamically included parts, it may be the most
2769     recent of the set of last-modify times for its component parts. For
2770     database gateways, it may be the last-update timestamp of the
2771     record. For virtual objects, it may be the last time the internal
2772     state changed.
2773    
2774     8.18 Link
2775    
2776     The Link header provides a means for describing a relationship
2777     between the entity and some other resource. An entity may include
2778     multiple Link values. Links at the metainformation level typically
2779     indicate relationships like hierarchical structure and navigation
2780     paths. The Link field is semantically equivalent to the <LINK>
2781     element in HTML [4].
2782    
2783     Link = "Link" ":" #("<" URI ">"
2784     [ ";" "rel" "=" relationship ]
2785     [ ";" "rev" "=" relationship ]
2786     [ ";" "title" "=" quoted-string ] )
2787    
2788     relationship = sgml-name
2789     | ( <"> sgml-name *( SP sgml-name) <"> )
2790    
2791     sgml-name = ALPHA *( ALPHA | DIGIT | "." | "-" )
2792    
2793     Relation values are not case-sensitive and may be extended within
2794     the constraints of the sgml-name syntax. There are no predefined
2795     link relationship values for HTTP/1.0. The title parameter may be
2796     used to label the destination of a link such that it can be used as
2797     identification within a human-readable menu. Examples of usage
2798     include:
2799    
2800     Link: <http://www.cern.ch/TheBook/chapter2>; rel="Previous"
2801    
2802     Link: <mailto:timbl@w3.org>; rev="Made"; title="Tim Berners-Lee"
2803    
2804     The first example indicates that the entity is previous to chapter2
2805     in a logical navigation path. The second indicates that the person
2806     responsible for making the resource available is identified by the
2807     given e-mail address.
2808    
2809     8.19 Location
2810    
2811     The Location response header field defines the exact location of
2812     the resource that was identified by the Request-URI. For 2xx
2813     responses, the location should be the URL needed to retrieve that
2814     same resource again (i.e., if variants of that resource are
2815     available, the value of the Location field should locate the
2816     variant chosen by the server if it has its own specific URL). For
2817     3xx responses, the location should indicate the server's preferred
2818     URL for automatic redirection to the resource. Only one absolute
2819     URL is allowed.
2820    
2821     Location = "Location" ":" absoluteURI
2822    
2823     An example is
2824    
2825     Location: http://www.w3.org/hypertext/WWW/NewLocation.html
2826    
2827     If no base URL is provided by or within the entity, the value of
2828     the Location field should be used as the base for resolving
2829     relative URLs [10].
2830    
2831     8.20 MIME-Version
2832    
2833     HTTP is not a MIME-conformant protocol (see Appendix C). However,
2834     HTTP/1.0 messages may include a single MIME-Version header field to
2835     indicate what version of the MIME protocol was used to construct
2836     the message. Use of the MIME-Version header field should indicate
2837     that the message is in full compliance with the MIME protocol (as
2838     defined in [6]). Unfortunately, current versions of HTTP/1.0
2839     clients and servers use this field indiscriminately, and thus
2840     receivers must not take it for granted that the message is indeed
2841     in full compliance with MIME. Gateways are responsible for ensuring
2842     this compliance (where possible) when exporting HTTP messages to
2843     strict MIME environments. Future HTTP/1.0 applications must only
2844     use MIME-Version when the message is intended to be MIME-conformant.
2845    
2846     MIME-Version = "MIME-Version" ":" 1*DIGIT "." 1*DIGIT
2847    
2848     MIME version "1.0" is the default for use in HTTP/1.0. However,
2849     HTTP/1.0 message parsing and semantics are defined by this document
2850     and not the MIME specification.
2851    
2852     8.21 Orig-URI
2853    
2854     The Orig-URI request header field allows the client to specify, for
2855     the server's benefit, the original Uniform Resource Identifier
2856     (Section 3.2) of the resource being requested, as it was obtained
2857     from the user or the referring resource. This allows a server to
2858     differentiate between internally-ambiguous URLs (such as the root
2859     "/" URL of a server harboring multiple virtual hostnames), to learn
2860     about new URNs used to reference resources on the server, and to
2861     provide some additional assistance in identifying and redirecting
2862     moved resources and resource fragments.
2863    
2864     Orig-URI = "Orig-URI" ":" absoluteURI [ "#" fragment ]
2865    
2866     Example:
2867    
2868     Orig-URI: http://www.w3.org/
2869    
2870     The URI must be in absolute form and should include the fragment if
2871     one is given to the client. It should include exactly what was
2872     referenced by the Referer resource, with the exception that a
2873     relative reference must first be resolved to its absolute form.
2874    
2875     8.22 Pragma
2876    
2877     The Pragma message header field is used to specify directives that
2878     should be applied to all intermediaries along the request/response
2879     chain. The directives typically specify behavior intended to
2880     prevent intermediate proxies or caches from adversely interfering
2881     with the request or response. All pragma directives specify
2882     optional behavior from the viewpoint of the protocol; however, some
2883     systems may require that behavior be consistent with the
2884     directives. HTTP/1.0 defines semantics for the "no-cache" and
2885     "max-age" directives.
2886    
2887     Pragma = "Pragma" ":" #pragma-directive
2888    
2889     pragma-directive = "no-cache"
2890     | "max-age" "=" delta-seconds
2891     | extension-pragma
2892     extension-pragma = token [ "=" word ]
2893    
2894     When the "no-cache" directive is present in a request message, a
2895     caching intermediary should forward the request toward the origin
2896     server even if it has a cached copy of what is being requested.
2897     This allows a client to insist upon receiving an authoritative
2898     response to its request. It also allows a client to refresh a
2899     cached copy which is known to be corrupted or stale.
2900    
2901     When the "no-cache" directive is present in a response message,
2902     caching intermediaries are requested to not cache this response.
2903     This allows an origin server to state that the message is intended
2904     for only one recipient and may not be a valid response for other
2905     requests.
2906    
2907     When the "max-age" directive is present in a request message, a
2908     caching intermediary should forward the request toward the origin
2909     server if it has no cached copy, or refresh its cached copy if it
2910     is older than the age value given (in seconds) prior to returning a
2911     response. A cached copy's "age" is determined by the cached
2912     message's Date header field, or the equivalent as stored by the
2913     cache manager. In most cases, a cached copy can be refreshed by
2914     forwarding a conditional GET request toward the origin server with
2915     the stored message's Date value in the If-Modified-Since field. If
2916     a 304 (not modified) response is received, the cache should replace
2917     the cached message's Date with that of the 304 response and send
2918     this refreshed message as the response. Any other response should
2919     be forwarded directly to the requestor and, depending on the
2920     response code and the discretion of the cache manager, may replace
2921     the message in the cache.
2922    
2923     When the "max-age" directive is present in a cached response
2924     message, a caching intermediary should refresh the message if it is
2925     older than the age value given (in seconds) at the time of a new
2926     request for that resource. The behavior should be equivalent to
2927     what would occur if the request had included that pragma directive.
2928     If both the new request and the cached message have max-age
2929     specified, then the lesser of the two values should be used.
2930    
2931     Pragma directives must be passed through by a proxy, regardless of
2932     their significance to that proxy, since the directives may be
2933     applicable to all intermediaries along the request/response chain.
2934     It is not possible to specify a pragma for a specific proxy;
2935     however, any pragma directive not relevant to a proxy should be
2936     ignored.
2937    
2938     Pragma directives do not apply to the end-points of a
2939     request/response chain. For example, a user agent's internal (non-
2940     shared) cache and/or history mechanism should ignore all pragma
2941     directives in received messages. Similarly, pragma directives are
2942     not applicable to the origin of a resource, though they may be
2943     applicable to a server's internal response cache.
2944    
2945     8.23 Public
2946    
2947     The Public response header field lists the set of non-standard
2948     methods supported by the server. The purpose of this field is
2949     strictly to inform the recipient of the capabilities of the server
2950     regarding unusual methods. The methods listed may or may not be
2951     applicable to the Request-URI; the Allow header field (Section 8.5)
2952     should be used to indicate methods allowed for a particular URI.
2953     This does not prevent a client from trying other methods. The field
2954     value should not include the methods predefined for HTTP/1.0 in
2955     Section 5.2.
2956    
2957     Public = "Public" ":" #method
2958    
2959     Example of use:
2960    
2961     Public: OPTIONS, MGET, MHEAD
2962    
2963     This header field applies only to the server directly connected to
2964     the client (i.e., the nearest neighbor in a chain of connections).
2965     If the response passes through a proxy, the proxy must either
2966     remove the Public header field or replace it with one applicable to
2967     its own capabilities.
2968    
2969     8.24 Referer
2970    
2971     The Referer request header field allows the client to specify, for
2972     the server's benefit, the address (URI) of the resource from which
2973     the Request-URI was obtained. This allows a server to generate
2974     lists of back-links to resources for interest, logging, optimized
2975     caching, etc. It also allows obsolete or mistyped links to be
2976     traced for maintenance. The Referer field must not be sent if the
2977     Request-URI was obtained from a source that does not have its own
2978     URI, such as input from the user keyboard.
2979    
2980     Referer = "Referer" ":" ( absoluteURI | relativeURI )
2981    
2982     Example:
2983    
2984     Referer: http://info.cern.ch/hypertext/DataSources/Overview.html
2985    
2986     If a partial URI is given, it should be interpreted relative to the
2987     Request-URI. The URI must not include a fragment.
2988    
2989     Note: Because the source of a link may be private
2990     information or may reveal an otherwise private information
2991     source, it is strongly recommended that the user be able to
2992     select whether or not the Referer field is sent. For
2993     example, a browser client could have a toggle switch for
2994     browsing openly/anonymously, which would respectively
2995     enable/disable the sending of Referer and From information.
2996    
2997     8.25 Retry-After
2998    
2999     The Retry-After response header field can be used with a 503
3000     (service unavailable) response to indicate how long the service is
3001     expected to be unavailable to the requesting client. The value of
3002     this field can be either an HTTP-date or an integer number of
3003     seconds (in decimal) after the time of the response.
3004    
3005     Retry-After = "Retry-After" ":" ( HTTP-date | delta-seconds )
3006    
3007     Two examples of its use are
3008    
3009     Retry-After: Wed, 14 Dec 1994 18:22:54 GMT
3010    
3011     Retry-After: 120
3012    
3013     In the latter example, the delay is 2 minutes.
3014    
3015     8.26 Server
3016    
3017     The Server response header field contains information about the
3018     software used by the origin server to handle the request. The field
3019     can contain multiple product tokens (Section 3.10) identifying the
3020     server and any significant subproducts. By convention, the product
3021     tokens are listed in order of their significance for identifying
3022     the application.
3023    
3024     Server = "Server" ":" 1*( product )
3025    
3026     Example:
3027    
3028     Server: CERN/3.0 libwww/2.17
3029    
3030     If the response is being forwarded through a proxy, the proxy
3031     application must not add its data to the product list. Instead, it
3032     should include a Forwarded field (as described in Section 8.14).
3033    
3034     Note: Revealing the specific software version of the server
3035     may allow the server machine to become more vulnerable to
3036     attacks against software that is known to contain security
3037     holes. Server implementors are encouraged to make this field
3038     a configurable option.
3039    
3040     8.27 Title
3041    
3042     The Title header field indicates the title of the entity
3043    
3044     Title = "Title" ":" *text
3045    
3046     An example of the field is
3047    
3048     Title: Hypertext Transfer Protocol -- HTTP/1.0
3049    
3050     This field is isomorphic with the <TITLE> element in HTML [4].
3051    
3052     8.28 URI
3053    
3054     The URI-header field may contain some or all of the Uniform
3055     Resource Identifiers (Section 3.2) by which the Request-URI
3056     resource can be identified. There is no guarantee that the resource
3057     can be accessed using the URI(s) specified.
3058    
3059     URI-header = "URI" ":" #( "<" ( absoluteURI | relativeURI ) ">"
3060     [ ";" vary ] *( ";" characteristic) )
3061    
3062     vary = "vary" "="
3063     ( vary-dimension | ( <"> 1#vary-dimension <"> ) )
3064    
3065     vary-dimension = "type" | "charset" | "language" | "encoding"
3066     | "user-agent" | "version" | token
3067    
3068     characteristic = ( "type={" media-type "}" )
3069     | ( "language={" 1#language-tag "}" )
3070     | ( "encoding={" 1#encoding-mechanism "}" )
3071     | ( "length=" 1*DIGIT )
3072     | ( "qs=" qvalue )
3073    
3074     Any URI specified in this field can be either absolute or relative
3075     to the Request-URI.
3076    
3077     If the Location header field is present in a 2xx response, its
3078     value defines an implicit URI header with the characteristic
3079     parameters defined by the associated Content-* header fields.
3080    
3081     The URI-header may be used by a client performing a POST request to
3082     suggest a URI for the new entity. Whether or not the suggested URI
3083     is used is entirely up to the server to decide. In any case, the
3084     server's response must include the actual URI(s) of the new
3085     resource if one is successfully created (status 201).
3086    
3087     If a URI refers to a set of variants, then the dimensions of that
3088     variance must be given with a vary parameter. One example is:
3089    
3090     URI: <http://info.cern.ch/hypertext/WWW/TheProject.multi>;
3091     vary="type,language"
3092    
3093     which indicates that the URI covers a group of entities that vary
3094     in media type and natural language. A request for that URI will
3095     result in a response that depends upon the client's request headers
3096     for Accept and Accept-Language. Similar dimensions exist for the
3097     Accept-Encoding, Accept-Charset, and User-Agent header fields, as
3098     demonstrated in the following example.
3099    
3100     URI: <TheProject.ps>; vary="encoding,version";
3101     type={application/postscript},
3102     <TheProject.html>; vary="user-agent,charset,version";
3103     type={text/html},
3104     <TheProject.html3;v=25>; type={text/html; level=3}; qs=0.9
3105    
3106     User agents may use this information to notify the user of
3107     additional formats.
3108    
3109     The vary parameter has an important effect on cache management,
3110     particularly for caching intermediaries which service a diverse set
3111     of user agents. Since the response to one user agent may differ
3112     from the response to a second user agent if the two agents have
3113     differing request profiles, a caching intermediary must keep track
3114     of the content metainformation for resources with varying
3115     dimensions. Thus, the vary parameter tells the intermediary what
3116     entity headers must be part of the key for caching that URI. When
3117     the caching proxy gets a request for that URI, it must forward the
3118     request toward the origin server if the request profile includes a
3119     variant dimension that has not already been cached.
3120    
3121     If the origin server provides the characteristics of each
3122     identified resource as part of the URI header, then the recipient
3123     may improve its cached response behavior by attempting to duplicate
3124     the content negotiation that would be provided by the server. This
3125     is not required by the protocol, but may improve the accuracy or
3126     timeliness of responses to the end-user.
3127    
3128     8.29 User-Agent
3129    
3130     The User-Agent field contains information about the user agent
3131     originating the request. This is for statistical purposes, the
3132     tracing of protocol violations, and automated recognition of user
3133     agents for the sake of tailoring responses to avoid particular user
3134     agent limitations. Although it is not required, user agents should
3135     always include this field with requests. The field can contain
3136     multiple product tokens (Section 3.10) identifying the agent and
3137     any subproducts which form a significant part of the user agent.
3138     By convention, the product tokens are listed in order of their
3139     significance for identifying the application.
3140    
3141     User-Agent = "User-Agent" ":" 1*( product )
3142    
3143     Example:
3144    
3145     User-Agent: CERN-LineMode/2.15 libwww/2.17b3
3146    
3147     The User-Agent field may include additional information within
3148     comments.
3149    
3150     Note: Some current proxy applications append their product
3151     information to the list in the User-Agent field. This is no
3152     longer recommended, since it makes machine interpretation of
3153     these fields ambiguous. Instead, proxies should use the
3154     Forwarded header described in Section 8.14.
3155    
3156     8.30 WWW-Authenticate
3157    
3158     The WWW-Authenticate header field must be included in 401
3159     (unauthorized) and 411 (authorization refused) response messages.
3160     The field value consists of a challenge that indicates the
3161     authentication scheme and parameters applicable to the Request-URI.
3162    
3163     WWW-Authenticate = "WWW-Authenticate" ":" challenge
3164    
3165     The HTTP access authentication process is described in Section 10.
3166    
3167     9. Content Negotiation
3168    
3169     Content negotiation is an optional feature of the HTTP protocol. It
3170     is designed to allow for selection of a preferred content
3171     representation, within a single request-response round-trip, and
3172     without intervention from the user. However, this may not always be
3173     desirable for the user and is sometimes unnecessary for the content
3174     provider. Implementors are encouraged to provide mechanisms whereby
3175     the amount of preemptive content negotiation, and the parameters of
3176     that negotiation, are configurable by the user and server
3177     maintainer.
3178    
3179     The first step in the negotiation algorithm is for the server to
3180     determine whether or not there are any content variants for the
3181     requested resource. Content variants may be in the form of multiple
3182     preexisting entities or a set of dynamic conversion filters. These
3183     variants make up the set of entities which may be sent in response
3184     to a request for the given Request-URI. In most cases, there will
3185     only be one available form of the resource, and thus a single
3186     "variant".
3187    
3188     For each variant form of the resource, the server identifies a set
3189     of quality values (Section 3.9) which act as weights for measuring
3190     the desirability of that resource as a response to the current
3191     request. The calculated weights are all real numbers in the range
3192     0 through 1, where 0 is the minimum and 1 the maximum value. The
3193     maximum acceptable bytes for each media range and the size of the
3194     resource variant are also factors in the equation.
3195    
3196     The following parameters are included in the calculation:
3197    
3198     qs Source quality is measured by the content provider as
3199     representing the amount of degradation from the original
3200     source. For example, a picture originally in JPEG form
3201     would have a lower qs when translated to the XBM format,
3202     and much lower qs when translated to an ASCII-art
3203     representation. Note, however, that this is a function of
3204     the source -- an original piece of ASCII-art may degrade in
3205     quality if it is captured in JPEG form. The qs value should
3206     be assigned to each variant by the content provider; if no
3207     qs value has been assigned, the default is generally
3208     "qs=1". A server may define its own default qs value based
3209     on the resource characteristics, but only if individual
3210     resources can override those defaults.
3211    
3212     qe Encoding quality is measured by comparing the variant's
3213     applied encoding-mechanisms (Section 3.6) to those listed
3214     in the request message's Accept-Encoding field. If the
3215     variant has no assigned Content-Encoding, or if no Accept-
3216     Encoding field is present, the value assigned is "qe=1". If
3217     all of the variant's content encodings are listed in the
3218     Accept-Encoding field, then the value assigned is "qe=1".
3219     If any of the variant's content encodings are not listed in
3220     the provided Accept-Encoding field, then the value assigned
3221     is "qe=0.001".
3222    
3223     qc Charset quality is measured by comparing the variant media-
3224     type's charset parameter value (if any) to those character
3225     set encodings (Section 3.5) listed in the request message's
3226     Accept-Charset field. If the variant's media-type has no
3227     charset parameter, or the variant's charset is US-ASCII or
3228     ISO-8859-1, or if no Accept-Charset field is present, then
3229     the value assigned is "qc=1". If the variant's charset is
3230     listed in the Accept-Charset field, then the value assigned
3231     is "qc=1". Otherwise, if the variant's charset is not
3232     listed in the provided Accept-Encoding field, then the
3233     value assigned is "qc=0.001".
3234    
3235     ql Language quality is measured by comparing the variant's
3236     assigned language tag(s) (Section 3.8) to those listed in
3237     the request message's Accept-Language field. If no variant
3238     has an assigned Content-Language, or if no Accept-Language
3239     field is present, the value assigned is "ql=1". If at least
3240     one variant has an assigned content language, but the one
3241     currently under consideration does not, then it should be
3242     assigned the value "ql=0.5". If any of the variant's
3243     content languages are listed in the Accept-Language field,
3244     then the value assigned is the maximum of the "ql"
3245     parameter values for those language tags (Section 8.4); if
3246     there was no exact match and at least one of the Accept-
3247     Language field values is a complete subtag prefix of the
3248     content language tag(s), then the "ql" parameter value of
3249     the largest matching prefix is used. If none of the
3250     variant's content language tags or tag prefixes are listed
3251     in the provided Accept-Language field, then the value
3252     assigned is "ql=0.001".
3253    
3254     q Media type quality is measured by comparing the variant's
3255     assigned media type (Section 3.4) to those listed in the
3256     request message's Accept field. If no Accept field is
3257     given, then the value assigned is "q=1". If at least one
3258     listed media range (Section 8.1) matches the variant's
3259     media type, then the "q" parameter value assigned to the
3260     most specific of those matched is used (e.g.,
3261     "text/html;version=3.0" is more specific than "text/html",
3262     which is more specific than "text/*", which in turn is more
3263     specific than "*/*"). If no media range in the provided
3264     Accept field matches the variant's media type, then the
3265     value assigned is "q=0".
3266    
3267     mxb The maximum number of bytes in an Entity-Body that the
3268     client will accept is also obtained from the matching of
3269     the variant's assigned media type to those listed in the
3270     request message's Accept field. If no Accept field is
3271     given, or if no media range in the provided Accept field
3272     matches the variant's media type, then the value assigned
3273     is "mxb=undefined" (i.e., infinity). Otherwise, the value
3274     used is that given to the "mxb" parameter in the media
3275     range chosen above for the q value.
3276    
3277     bs The actual number of bytes in the Entity-Body for the
3278     variant when it is included in a response message. This
3279     should equal the value of Content-Length.
3280    
3281     The mapping function is defined as:
3282    
3283     Q(qs,qe,qc,ql, { if mxb=undefined, then (qs*qe*qc*ql*q) }
3284     q,mxb,bs) = { if mxb >= bs, then (qs*qe*qc*ql*q) }
3285     { if mxb < bs, then 0 }
3286    
3287     The variants with a maximal value for the Q function represent the
3288     preferred representation(s) of the entity; those with a Q values
3289     less than the maximal value are therefore excluded from further
3290     consideration. If multiple representations exist that only vary by
3291     Content-Encoding, then the smallest representation (lowest bs) is
3292     preferred.
3293    
3294     If no variants remain with a value of Q greater than zero (0), the
3295     server should respond with a 406 (none acceptable) response
3296     message. If multiple variants remain with an equally high Q value,
3297     the server may either choose one from those available and respond
3298     with 200 (ok) or respond with 300 (multiple choices) and include an
3299     entity describing the choices. In the latter case, the entity
3300     should either be of type "text/html', such that the user can choose
3301     from among the choices by following an exact link, or of some type
3302     that would allow the user agent to perform the selection
3303     automatically.
3304    
3305     The 300 (multiple choices) response can be given even if the server
3306     does not perform any winnowing of the representation choices via
3307     the content negotiation algorithm described above. Furthermore, it
3308     may include choices that were not considered as part of the
3309     negotiation algorithm and resources that may be located at other
3310     servers.
3311    
3312     Servers that make use of content negotiated resources are strongly
3313     encouraged to include URI response headers which accurately
3314     describe the available variants and include the relevant parameters
3315     necessary for the client (user agent or proxy) to evaluate those
3316     variants.
3317    
3318     The algorithm presented above assumes that the user agent has
3319     correctly implemented the protocol and is accurately communicating
3320     its intentions in the form of Accept-related header fields. The
3321     server may alter its response if it knows that the particular
3322     version of user agent software making the request has incorrectly
3323     or inadequately implemented these fields.
3324    
3325     10. Access Authentication
3326    
3327     HTTP provides a simple challenge-response authorization style which
3328     may be used by a server to challenge a client request and by a
3329     client to provide authentication information. It uses an
3330     extensible, case-insensitive token to identify the authentication
3331     scheme, followed by a semicolon-separated list of attribute-value
3332     pairs which carry the parameters necessary for achieving
3333     authentication via that scheme.
3334    
3335     auth-scheme = "basic" | token
3336    
3337     auth-param = token "=" quoted-string
3338    
3339     The 401 (unauthorized) response message is used by an origin server
3340     to challenge the authorization of a user agent. This response must
3341     include a WWW-Authenticate header field containing a challenge
3342     applicable to the requested resource.
3343    
3344     challenge = auth-scheme 1*SP realm *( ";" auth-param )
3345    
3346     realm = "realm" "=" quoted-string
3347    
3348     The realm attribute (case-insensitive) is required for all
3349     authentication schemes which issue a challenge. The realm value
3350     (case-sensitive), in combination with the root URL of the server
3351     being accessed, defines the protection space. These realms allow
3352     the protected resources on a server to be partitioned into a set of
3353     protection spaces, each with its own authentication scheme and/or
3354     authorization database. The realm value is a string, generally
3355     assigned by the origin server, which may have additional semantics
3356     specific to the authentication scheme.
3357    
3358     A user agent that wishes to authenticate itself with a server--
3359     usually, but not necessarily, after receiving a 401 or 411 response--
3360     may do so by including an Authorization header field with the
3361     request. The Authorization field value consists of credentials
3362     containing the authentication information of the user agent for the
3363     realm of the resource being requested.
3364    
3365     credentials = auth-scheme [ 1*LWS encoded-cookie ]
3366     *(";" auth-param )
3367    
3368     encoded-cookie = <any valid base64 [6] encoded string,
3369     except not limited to 76 char/line>
3370    
3371     The domain over which credentials can be automatically applied by a
3372     user agent is determined by the authorization space. If a request
3373     is authenticated, the credentials can be reused for all other
3374     requests within that authorization space for a period of time
3375     determined by the authentication scheme, parameters, and/or user
3376     preference.
3377    
3378     If the server does not wish to accept the credentials sent with a
3379     request, it should return either a 403 (forbidden) or 411
3380     (authorization refused) response. In the latter case, the response
3381     must include a WWW-Authenticate header field containing the
3382     (possibly new) challenge applicable to the requested resource and
3383     an entity explaining the refusal.
3384    
3385     The HTTP protocol does not restrict applications to this simple
3386     challenge-response mechanism for access authentication. Additional
3387     mechanisms may be used at the transport level, via message
3388     encapsulation, and/or with additional header fields specifying
3389     authentication information. However, these additional mechanisms
3390     are not defined by this specification.
3391    
3392     Proxies must be completely transparent regarding user agent
3393     authentication. That is, they must forward the WWW-Authenticate and
3394     Authorization headers untouched. HTTP/1.0 does not provide a means
3395     for a client to be authenticated with a proxy.
3396    
3397     Note: The names Proxy-Authenticate and Proxy-Authorization
3398     have been suggested as headers, analogous to
3399     WWW-Authenticate and Authorization, but applying only to the
3400     immediate connection with a proxy.
3401    
3402     10.1 Basic Authentication Scheme
3403    
3404     The basic authentication scheme is based on the model that the
3405     client must authenticate itself with a user-ID and a password for
3406     each realm. The realm value should be considered an opaque string
3407     which can only be compared for equality with other realms. The
3408     server will service the request only if it can validate the user-ID
3409     and password for the domain of the Request-URI.
3410    
3411     basic-challenge= "Basic" SP realm
3412    
3413     The client sends the user-ID and password, separated by a single
3414     colon ":" character, within a base64 [6] encoded-cookie in the
3415     credentials.
3416    
3417     basic-credentials="Basic" SP basic-cookie
3418     basic-cookie = <base64 encoding of userid-password>
3419     userid-password= [ token ] ":" *text
3420    
3421     There are no optional authentication parameters for the basic
3422     scheme. For example, if the user agent wishes to send the user-ID
3423     "Aladdin" and password "open sesame", it would use the following
3424     header field:
3425    
3426     Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
3427    
3428     The basic authentication scheme is a non-secure method of filtering
3429     unauthorized access to resources on an HTTP server. It is based on
3430     the assumption that the connection between the client and the
3431     server can be regarded as a trusted carrier. As this is not
3432     generally true on an open network, the basic authentication scheme
3433     should be used accordingly. In spite of this, clients are
3434     encouraged to implement the scheme in order to communicate with
3435     servers that use it.
3436    
3437     11. Security Considerations
3438    
3439     This section is meant to inform application developers, information
3440     providers, and users of the security limitations in HTTP/1.0 as
3441     described by this document. The discussion does not include
3442     definitive solutions to the problems revealed, though it does make
3443     some suggestions for reducing security risks.
3444    
3445     11.1 Authentication of Clients
3446    
3447     As mentioned in Section 10.1, the Basic authentication scheme is
3448     not a secure method of user authentication, nor does it prevent the
3449     Entity-Body from being transmitted in clear text across the
3450     physical network used as the carrier. HTTP/1.0 does not prevent
3451     additional authentication schemes and encryption mechanisms to be
3452     employed to increase security.
3453    
3454     11.2 Idempotent Methods
3455    
3456     The writers of client software should be aware that the software
3457     represents the user in their interactions over the net, and should
3458     be careful to allow the user to be aware of any actions they may
3459     take which may have an unexpected significance to themselves or
3460     others.
3461    
3462     In particular, the convention has been established that the GET and
3463     HEAD methods should never have the significance of taking an action
3464     other than retrieval. These methods should be considered "safe" and
3465     should not have side effects. This allows the client software to
3466     represent other methods, such as POST, PUT and DELETE, in a special
3467     way, so that the user is aware of the fact that an non-idempotent
3468     action is being requested.
3469    
3470     Naturally, it is not possible to ensure that the server does not
3471     generate side-effects as a result of performing a GET request; in
3472     fact, some dynamic resources consider that a feature. The important
3473     distinction here is that the user did not request the side-effects,
3474     so therefore cannot be held accountable for them.
3475    
3476     11.3 Abuse of Server Log Information
3477    
3478     A server is in the position to save personal data about a user's
3479     requests which may identify their reading patterns or subjects of
3480     interest. This information is clearly confidential in nature and
3481     its handling may be constrained by law in certain countries. People
3482     using the HTTP protocol to provide data are responsible for
3483     ensuring that such material is not distributed without the
3484     permission of any individuals that are identifiable by the
3485     published results.
3486    
3487     11.4 Transfer of Sensitive Information
3488    
3489     Like any generic data transfer protocol, HTTP cannot regulate the
3490     content of the data that is transferred, nor is there any apriori
3491     method of determining the sensitivity of any particular piece of
3492     information within the context of any given request. Therefore,
3493     applications are encouraged to supply as much control over this
3494     information as possible to the provider of that information. Four
3495     header fields are worth special mention in this context: Server,
3496     Forwarded, Referer and From.
3497    
3498     Revealing the specific software version of the server may allow the
3499     server machine to become more vulnerable to attacks against
3500     software that is known to contain security holes. Implementors are
3501     encouraged to make the Server header field a configurable option.
3502    
3503     Proxies which serve as a gateway through a network firewall should
3504     take special precautions regarding the transfer of header
3505     information that identifies the hosts behind the firewall. In
3506     particular, they should remove, or replace with sanitized versions,
3507     any Forwarded fields generated behind the firewall.
3508    
3509     The Referer field allows reading patterns to be studied and reverse
3510     links drawn. Although it can be very useful, its power can be
3511     abused if user details are not separated from the information
3512     contained in the Referer. Even when the personal information has
3513     been removed, the Referer field may indicate a private document's
3514     URI whose publication would be inappropriate.
3515    
3516     The information sent in the From field might conflict with the
3517     user's privacy interests or their site's security policy, and hence
3518     it should not be transmitted without the user being able to
3519     disable, enable, and modify the contents of the field. The user
3520     must be able to set the contents of this field within a user
3521     preference or application defaults configuration.
3522    
3523     We suggest, though do not require, that a convenient toggle
3524     interface be provided for the user to enable or disable the sending
3525     of From and Referer information.
3526    
3527     12. Acknowledgments
3528    
3529     This specification makes heavy use of the augmented BNF and generic
3530     constructs defined by David H. Crocker for RFC 822 [8]. Similarly,
3531     it reuses many of the definitions provided by Nathaniel Borenstein
3532     and Ned Freed for MIME [6]. We hope that their inclusion in this
3533     specification will help reduce past confusion over the relationship
3534     between HTTP/1.0 and Internet mail message formats.
3535    
3536     The HTTP protocol has evolved considerably over the past three
3537     years. It has benefited from a large and active developer community--
3538     the many people who have participated on the www-talk mailing list--
3539     and it is that community which has been most responsible for the
3540     success of HTTP and of the World-Wide Web in general.
3541     Marc Andreessen, Robert Cailliau, Daniel W. Connolly, Bob Denny,
3542     Jean Francois-Groff, Phillip M. Hallam-Baker, Haringkon W. Lie,
3543     Ari Luotonen, Rob McCool, Dave Raggett, Tony Sanders, and
3544     Marc VanHeyningen deserve special recognition for their efforts in
3545     defining aspects of the protocol for early versions of this
3546     specification.
3547    
3548     This document has benefited greatly from the comments of all those
3549     participating in the HTTP-WG. In addition to those already
3550     mentioned, the following individuals have contributed to this
3551     specification:
3552    
3553     Gary Adams Harald Tveit Alvestrand
3554     Keith Ball Brian Behlendorf
3555     Paul Burchard Maurizio Codogno
3556     Mike Cowlishaw Roman Czyborra
3557     Michael A. Dolan John Franks
3558     Marc Hedlund Koen Holtman
3559     Alex Hopmann Bob Jernigan
3560     Shel Kaphan Martijn Koster
3561     Dave Kristol Daniel LaLiberte
3562     Albert Lunde John C. Mallery
3563     Larry Masinter Mitra
3564     Gavin Nicol Bill Perry
3565     Jeffrey Perry Owen Rees
3566     David Robinson Marc Salomon
3567     Rich Salz Jim Seidman
3568     Chuck Shotton Eric W. Sink
3569     Simon E. Spero Robert S. Thau
3570     Francois Yergeau Mary Ellen Zurko
3571    
3572     13. References
3573    
3574     [1] H. Alvestrand. "Tags for the identification of languages."
3575     RFC 1766, UNINETT, March 1995.
3576    
3577     [2] F. Anklesaria, M. McCahill, P. Lindner, D. Johnson, D. Torrey,
3578     and B. Alberti. "The Internet Gopher Protocol: A distributed
3579     document search and retrieval protocol." RFC 1436, University
3580     of Minnesota, March 1993.
3581    
3582     [3] T. Berners-Lee. "Universal Resource Identifiers in WWW: A
3583     Unifying Syntax for the Expression of Names and Addresses of
3584     Objects on the Network as used in the World-Wide Web."
3585     RFC 1630, CERN, June 1994.
3586    
3587     [4] T. Berners-Lee and D. Connolly. "HyperText Markup Language
3588     Specification - 2.0." Work in Progress
3589     (draft-ietf-html-spec-04.txt), MIT/W3C, June 1995.
3590    
3591     [5] T. Berners-Lee, L. Masinter, and M. McCahill. "Uniform Resource
3592     Locators (URL)." RFC 1738, CERN, Xerox PARC, University of
3593     Minnesota, October 1994.
3594    
3595     [6] N. Borenstein and N. Freed. "MIME (Multipurpose Internet Mail
3596     Extensions) Part One: Mechanisms for Specifying and Describing
3597     the Format of Internet Message Bodies." RFC 1521, Bellcore,
3598     Innosoft, September 1993.
3599    
3600     [7] R. Braden. "Requirements for Internet hosts - application and
3601     support." STD 3, RFC 1123, IETF, October 1989.
3602    
3603     [8] D. H. Crocker. "Standard for the Format of ARPA Internet Text
3604     Messages." STD 11, RFC 822, UDEL, August 1982.
3605    
3606     [9] F. Davis, B. Kahle, H. Morris, J. Salem, T. Shen, R. Wang,
3607     J. Sui, and M. Grinbaum. "WAIS Interface Protocol Prototype
3608     Functional Specification." (v1.5), Thinking Machines
3609     Corporation, April 1990.
3610    
3611     [10] R. Fielding. "Relative Uniform Resource Locators." RFC 1808,
3612     UC Irvine, June 1995.
3613    
3614     [11] M. Horton and R. Adams. "Standard for interchange of USENET
3615     messages." RFC 1036 (Obsoletes RFC 850), AT&T Bell
3616     Laboratories, Center for Seismic Studies, December 1987.
3617    
3618     [12] B. Kantor and P. Lapsley. "Network News Transfer Protocol: A
3619     Proposed Standard for the Stream-Based Transmission of News."
3620     RFC 977, UC San Diego, UC Berkeley, February 1986.
3621    
3622     [13] K. Moore. "MIME (Multipurpose Internet Mail Extensions) Part
3623     Two: Message Header Extensions for Non-ASCII Text." RFC 1522,
3624     University of Tennessee, September 1993.
3625    
3626     [14] J. Postel. "Simple Mail Transfer Protocol." STD 10, RFC 821,
3627     USC/ISI, August 1982.
3628    
3629     [15] J. Postel. "Media Type Registration Procedure." RFC 1590,
3630     USC/ISI, March 1994.
3631    
3632     [16] J. Postel and J. K. Reynolds. "File Transfer Protocol (FTP)."
3633     STD 9, RFC 959, USC/ISI, October 1985.
3634    
3635     [17] J. Reynolds and J. Postel. "Assigned Numbers." STD 2, RFC 1700,
3636     USC/ISI, October 1994.
3637    
3638     [18] K. Sollins and L. Masinter. "Functional Requirements for
3639     Uniform Resource Names." RFC 1737, MIT/LCS, Xerox Corporation,
3640     December 1994.
3641    
3642     [19] US-ASCII. Coded Character Set - 7-Bit American Standard Code
3643     for Information Interchange. Standard ANSI X3.4-1986, ANSI,
3644     1986.
3645    
3646     [20] ISO-8859. International Standard -- Information Processing --
3647     8-bit Single-Byte Coded Graphic Character Sets -- Part 1: Latin
3648     Alphabet No. 1, ISO 8859-1:1987. Part 2: Latin alphabet No. 2,
3649     ISO 8859-2, 1987. Part 3: Latin alphabet No. 3, ISO 8859-3,
3650     1988. Part 4: Latin alphabet No. 4, ISO 8859-4, 1988. Part 5:
3651     Latin/Cyrillic alphabet, ISO 8859-5, 1988. Part 6: Latin/Arabic
3652     alphabet, ISO 8859-6, 1987. Part 7: Latin/Greek alphabet, ISO
3653     8859-7, 1987. Part 8: Latin/Hebrew alphabet, ISO 8859-8, 1988.
3654     Part 9: Latin alphabet No. 5, ISO 8859-9, 1990.
3655    
3656     14. Authors' Addresses
3657    
3658     Tim Berners-Lee
3659     Director, W3 Consortium
3660     MIT Laboratory for Computer Science
3661     545 Technology Square
3662     Cambridge, MA 02139, U.S.A.
3663     Tel: +1 (617) 253 5702
3664     Fax: +1 (617) 258 8682
3665     Email: timbl@w3.org
3666    
3667     Roy T. Fielding
3668     Department of Information and Computer Science
3669     University of California
3670     Irvine, CA 92717-3425, U.S.A.
3671     Tel: +1 (714) 824-4049
3672     Fax: +1 (714) 824-4056
3673     Email: fielding@ics.uci.edu
3674    
3675     Henrik Frystyk Nielsen
3676     W3 Consortium
3677     MIT Laboratory for Computer Science
3678     545 Technology Square
3679     Cambridge, MA 02139, U.S.A.
3680     Tel: +1 (617) 258 8143
3681     Fax: +1 (617) 258 8682
3682     Email: frystyk@w3.org
3683    
3684     Appendices
3685    
3686     These appendices are provided for informational reasons only -- they
3687     do not form a part of the HTTP/1.0 specification.
3688    
3689     A. Internet Media Type message/http
3690    
3691     In addition to defining the HTTP/1.0 protocol, this document serves
3692     as the specification for the Internet media type "message/http".
3693     The following is to be registered with IANA [15].
3694    
3695     Media Type name: message
3696    
3697     Media subtype name: http
3698    
3699     Required parameters: none
3700    
3701     Optional parameters: version, msgtype
3702    
3703     version: The HTTP-Version number of the enclosed message
3704     (e.g., "1.0"). If not present, the version can be
3705     determined from the first line of the body.
3706    
3707     msgtype: The message type -- "request" or "response". If
3708     not present, the type can be determined from the
3709     first line of the body.
3710    
3711     Encoding considerations: only "7bit", "8bit", or "binary" are
3712     permitted
3713    
3714     Security considerations: none
3715    
3716     B. Tolerant Applications
3717    
3718     Although this document specifies the requirements for the
3719     generation of HTTP/1.0 messages, not all applications will be
3720     correct in their implementation. We therefore recommend that
3721     operational applications be tolerant of deviations whenever those
3722     deviations can be interpreted unambiguously.
3723    
3724     Clients should be tolerant in parsing the StatusLine and servers
3725     tolerant when parsing the RequestLine. In particular, they should
3726     accept any amount of SP or HT characters between fields, even
3727     though only a single SP is required.
3728    
3729     The line terminator for HTTP-header fields is the sequence CRLF.
3730     However, we recommend that applications, when parsing such headers,
3731     recognize a single LF as a line terminator and ignore the leading
3732     CR.
3733    
3734     C. Relationship to MIME
3735    
3736     HTTP/1.0 reuses many of the constructs defined for Internet Mail
3737     (RFC 822 [8]) and the Multipurpose Internet Mail Extensions
3738     (MIME [6]) to allow entities to be transmitted in an open variety
3739     of representations and with extensible mechanisms. However, HTTP is
3740     not a MIME-conforming application. HTTP's performance requirements
3741     differ substantially from those of Internet mail. Since it is not
3742     limited by the restrictions of existing mail protocols and
3743     gateways, HTTP does not obey some of the constraints imposed by
3744     RFC 822 and MIME for mail transport.
3745    
3746     This appendix describes specific areas where HTTP differs from
3747     MIME. Gateways to MIME-compliant protocols must be aware of these
3748     differences and provide the appropriate conversions where
3749     necessary. No conversion should be necessary for a MIME-conforming
3750     entity to be transferred using HTTP.
3751    
3752     C.1 Conversion to Canonical Form
3753    
3754     MIME requires that an entity be converted to canonical form prior
3755     to being transferred, as described in Appendix G of RFC 1521 [6].
3756     Although HTTP does require media types to be transferred in
3757     canonical form, it changes the definition of "canonical form" for
3758     text-based media types as described in Section 3.4.1.
3759    
3760     C.1.1 Representation of Line Breaks
3761    
3762     MIME requires that the canonical form of any text type represent
3763     line breaks as CRLF and forbids the use of CR or LF outside of line
3764     break sequences. Since HTTP allows CRLF, bare CR, and bare LF
3765     (or the octet sequence(s) to which they would be translated for the
3766     given character set encoding) to indicate a line break within text
3767     content, recipients of an HTTP message cannot rely upon receiving
3768     MIME-canonical line breaks in text.
3769    
3770     Where it is possible, a gateway from HTTP to a MIME-conformant
3771     protocol should translate all line breaks within text/* media types
3772     to the MIME canonical form of CRLF. However, this may be
3773     complicated by the presence of a Content-Encoding and by the fact
3774     that HTTP allows the use of some character set encodings which do
3775     not use octets 13 and 10 to represent CR and LF, as is the case for
3776     some multi-byte character set encodings.
3777    
3778     C.1.2 Default Character Set Encoding
3779    
3780     MIME requires that all subtypes of the top-level Content-Type
3781     "text" have a default character set encoding of US-ASCII [19].
3782     In contrast, HTTP defines the default character set encoding for
3783     "text" to be ISO-8859-1 [20] (a superset of US-ASCII). Therefore,
3784     if a text/* media type given in the Content-Type header field does
3785     not already include an explicit charset parameter, the parameter
3786    
3787     ;charset="iso-8859-1"
3788    
3789     should be added by the gateway if the entity contains any octets
3790     greater than 127.
3791    
3792     C.2 Default Content-Transfer-Encoding
3793    
3794     The default Content-Transfer-Encoding (CTE) for all MIME messages
3795     is "7bit". In contrast, HTTP defines the default CTE to be
3796     "binary". Therefore, if an entity does not include an explicit CTE
3797     header field, the gateway should apply either the
3798     "quoted-printable" or "base64" transfer encodings and add the
3799     appropriate Content-Transfer-Encoding field. At a minimum, the
3800     explicit CTE field of
3801    
3802     Content-Transfer-Encoding: binary
3803    
3804     should be added by the gateway if it is unwilling to apply a
3805     mail-safe transfer encoding.
3806    
3807     C.3 Introduction of Content-Encoding
3808    
3809     MIME does not include any concept equivalent to HTTP's
3810     Content-Encoding header field. Since this acts as a modifier on the
3811     media type, gateways to MIME-conformant protocols should either
3812     change the value of the Content-Type header field or decode the
3813     Entity-Body before forwarding the message.
3814    
3815     Note: Some experimental applications of Content-Type for
3816     Internet mail have used a media-type parameter of
3817     ";conversions=<encoding-mechanisms>" to perform an
3818     equivalent function as Content-Encoding. However, this
3819     parameter is not part of the MIME specification at the time
3820     of this writing.
3821    

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24