idnits 2.17.1 draft-ietf-http-v10-spec-00.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- ** Cannot find the required boilerplate sections (Copyright, IPR, etc.) in this document. Expected boilerplate is as follows today (2024-04-25) according to https://trustee.ietf.org/license-info : IETF Trust Legal Provisions of 28-dec-2009, Section 6.a: This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79. IETF Trust Legal Provisions of 28-dec-2009, Section 6.b(i), paragraph 2: Copyright (c) 2024 IETF Trust and the persons identified as the document authors. All rights reserved. IETF Trust Legal Provisions of 28-dec-2009, Section 6.b(i), paragraph 3: This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- ** Missing expiration date. The document expiration date should appear on the first and last page. ** The document seems to lack a 1id_guidelines paragraph about Internet-Drafts being working documents. ** The document seems to lack a 1id_guidelines paragraph about the list of current Internet-Drafts. ** The document seems to lack a 1id_guidelines paragraph about the list of Shadow Directories. == No 'Intended status' indicated for this document; assuming Proposed Standard == The page length should not exceed 58 lines per page, but there was 1 longer page, the longest (page 1) being 3417 lines Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** The document seems to lack an IANA Considerations section. (See Section 2.2 of https://www.ietf.org/id-info/checklist for how to handle the case when there are no actions for IANA.) ** The document seems to lack separate sections for Informative/Normative References. All references will be assumed normative when checking for downward references. == There are 5 instances of lines with non-RFC2606-compliant FQDNs in the document. Miscellaneous warnings: ---------------------------------------------------------------------------- -- The document seems to lack a disclaimer for pre-RFC5378 work, but may have content which was first submitted before 10 November 2008. If you have contacted all the original authors and they are all willing to grant the BCP78 rights to the IETF Trust, then this is fine, and you can ignore this comment. If not, you may need to add the pre-RFC5378 disclaimer. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (March 8, 1995) is 10641 days in the past. Is this intentional? -- Found something which looks like a code comment -- if you have code sections in the document, please surround them with '' and '' lines. Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) -- Looks like a reference, but probably isn't: 'CRLF' on line 411 == Missing Reference: '0' is mentioned on line 2825, but not defined == Unused Reference: '10' is defined on line 3121, but no explicit reference was found in the text ** Obsolete normative reference: RFC 1766 (ref. '1') (Obsoleted by RFC 3066, RFC 3282) ** Downref: Normative reference to an Informational RFC: RFC 1436 (ref. '2') ** Downref: Normative reference to an Informational RFC: RFC 1630 (ref. '3') == Outdated reference: A later version (-05) exists of draft-ietf-html-spec-01 ** Downref: Normative reference to an Historic draft: draft-ietf-html-spec (ref. '4') ** Obsolete normative reference: RFC 1738 (ref. '5') (Obsoleted by RFC 4248, RFC 4266) ** Obsolete normative reference: RFC 1521 (ref. '6') (Obsoleted by RFC 2045, RFC 2046, RFC 2047, RFC 2048, RFC 2049) ** Obsolete normative reference: RFC 822 (ref. '8') (Obsoleted by RFC 2822) -- Possible downref: Non-RFC (?) normative reference: ref. '9' ** Obsolete normative reference: RFC 850 (ref. '11') (Obsoleted by RFC 1036) ** Obsolete normative reference: RFC 977 (ref. '12') (Obsoleted by RFC 3977) ** Obsolete normative reference: RFC 1522 (ref. '13') (Obsoleted by RFC 2045, RFC 2046, RFC 2047, RFC 2048, RFC 2049) ** Obsolete normative reference: RFC 821 (ref. '14') (Obsoleted by RFC 2821) ** Obsolete normative reference: RFC 1590 (ref. '15') (Obsoleted by RFC 2045, RFC 2046, RFC 2047, RFC 2048, RFC 2049) ** Obsolete normative reference: RFC 1700 (ref. '17') (Obsoleted by RFC 3232) -- Possible downref: Non-RFC (?) normative reference: ref. '18' -- Possible downref: Non-RFC (?) normative reference: ref. '19' Summary: 20 errors (**), 0 flaws (~~), 6 warnings (==), 7 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 1 HTTP Working Group T. Berners-Lee 2 INTERNET-DRAFT R. T. Fielding 3 H. Frystyk Nielsen 4 Expires September 8, 1995 March 8, 1995 6 Hypertext Transfer Protocol -- HTTP/1.0 8 Status of this Memo 10 This document is an Internet-Draft. Internet-Drafts are working 11 documents of the Internet Engineering Task Force (IETF), its areas, 12 and its working groups. Note that other groups may also distribute 13 working documents as Internet-Drafts. 15 Internet-Drafts are draft documents valid for a maximum of six 16 months and may be updated, replaced, or obsoleted by other 17 documents at any time. It is inappropriate to use Internet-Drafts 18 as reference material or to cite them other than as "work in 19 progress". 21 To learn the current status of any Internet-Draft, please check the 22 "1id-abstracts.txt" listing contained in the Internet-Drafts Shadow 23 Directories on ftp.is.co.za (Africa), nic.nordu.net (Europe), 24 munnari.oz.au (Pacific Rim), ds.internic.net (US East Coast), or 25 ftp.isi.edu (US West Coast). 27 Distribution of this document is unlimited. Please send comments to 28 the HTTP working group at . Discussions 29 of the working group are archived at 30 . General discussions 31 about HTTP and the applications which use HTTP should take place on 32 the mailing list. 34 Abstract 36 The Hypertext Transfer Protocol (HTTP) is an application-level 37 protocol with the lightness and speed necessary for distributed, 38 collaborative, hypermedia information systems. It is a generic, 39 stateless, object-oriented protocol which can be used for many 40 tasks, such as name servers and distributed object management 41 systems, through extension of its request methods (commands). A 42 feature of HTTP is the typing and negotiation of data 43 representation, allowing systems to be built independently of the 44 data being transferred. 46 HTTP has been in use by the World-Wide Web global information 47 initiative since 1990. This specification reflects preferred usage 48 of the protocol referred to as "HTTP/1.0", and is compatible with 49 the most commonly used HTTP server and client programs implemented 50 prior to November 1994. 52 Table of Contents 54 1. Introduction 55 1.1 Purpose 56 1.2 Overall Operation 57 1.3 Terminology 58 2. Notational Conventions and Generic Grammar 59 2.1 Augmented BNF 60 2.2 Basic Rules 61 3. Protocol Parameters 62 3.1 HTTP Version 63 3.2 Universal Resource Identifiers 64 3.3 Date/Time Formats 65 3.3.1 Full Date 66 3.3.2 Delta Seconds 67 4. HTTP Message 68 4.1 Message Types 69 4.2 Message Headers 70 4.3 General Message Header Fields 71 4.3.1 Date 72 4.3.2 Forwarded 73 4.3.3 Message-ID 74 4.3.4 MIME-Version 75 5. Request 76 5.1 Request-Line 77 5.2 Method 78 5.2.1 GET 79 5.2.2 HEAD 80 5.2.3 POST 81 5.2.4 PUT 82 5.2.5 DELETE 83 5.2.6 LINK 84 5.2.7 UNLINK 85 5.3 Request-URI 86 5.4 Request Header Fields 87 5.4.1 Accept 88 5.4.2 Accept-Charset 89 5.4.3 Accept-Encoding 90 5.4.4 Accept-Language 91 5.4.5 Authorization 92 5.4.6 From 93 5.4.7 If-Modified-Since 94 5.4.8 Pragma 95 5.4.9 Referer 96 5.4.10 User-Agent 97 6. Response 98 6.1 Status-Line 99 6.2 Status Codes and Reason Phrases 100 6.2.1 Successful 2xx 101 6.2.2 Redirection 3xx 102 6.2.3 Client Error 4xx 103 6.2.4 Server Errors 5xx 104 6.3 Response Header Fields 105 6.3.1 Public 106 6.3.2 Retry-After 107 6.3.3 Server 108 6.3.4 WWW-Authenticate 109 7. Entity 110 7.1 Entity Header Fields 111 7.1.1 Allow 112 7.1.2 Content-Encoding 113 7.1.3 Content-Language 114 7.1.4 Content-Length 115 7.1.5 Content-Transfer-Encoding 116 7.1.6 Content-Type 117 7.1.7 Derived-From 118 7.1.8 Expires 119 7.1.9 Last-Modified 120 7.1.10 Link 121 7.1.11 Location 122 7.1.12 Title 123 7.1.13 URI 124 7.1.14 Version 125 7.2 Entity Body 126 7.2.1 Type 127 7.2.2 Length 128 8. Content Parameters 129 8.1 Media Types 130 8.1.1 Canonicalization and Text Defaults 131 8.1.2 Multipart Types 132 8.2 Language Tags 133 8.3 Character Sets 134 8.4 Encoding Mechanisms 135 8.5 Transfer Encodings 136 9. Content Negotiation 137 10. Access Authentication 138 10.1 Basic Authentication Scheme 139 11. Security Considerations 140 11.1 Authentication of Clients 141 11.2 Idempotent Methods 142 11.3 Abuse of Server Log Information 143 12. Acknowledgments 144 13. References 145 14. Authors' Addresses 146 Appendix A. Internet Media Type message/http 147 Appendix B. Minimum Compliance 148 B.1 Servers 149 Appendix C. Tolerant Applications 150 C.1 Request-Line, Status-Line, and Header Fields 151 Appendix D. Relationship to MIME 152 D.1 Conversion to Canonical Form 153 D.1.1 Representation of Line Breaks 154 D.1.2 Default Character Set 155 D.2 Default Content-Transfer-Encoding 156 D.3 Introduction of Content-Encoding 157 Appendix E. Example of Version Control 159 1. Introduction 161 1.1 Purpose 163 The Hypertext Transfer Protocol (HTTP) is an application-level 164 protocol with the lightness and speed necessary for distributed, 165 collaborative, hypermedia information systems. HTTP has been in use 166 by the World-Wide Web global information initiative since 1990. 167 This specification reflects preferred usage of the protocol 168 referred to as "HTTP/1.0". This specification does not necessarily 169 reflect the "current practice" of any single HTTP server or client 170 implementation. It does, however, seek to remain compatible with 171 existing implementations wherever possible, and should be 172 considered the reference for future implementations of HTTP/1.0. 174 Practical information systems require more functionality than 175 simple retrieval, including search, front-end update, and 176 annotation. HTTP/1.0 allows an open-ended set of methods to be used 177 to indicate the purpose of a request. It builds on the discipline 178 of reference provided by the Universal Resource Identifier 179 (URI) [3], as a location (URL) [5] or name (URN), for indicating 180 the resource on which a method is to be applied. Messages are 181 passed in a format similar to that used by Internet Mail [8] and 182 the Multipurpose Internet Mail Extensions (MIME) [6]. 184 HTTP/1.0 is also used for communication between user agents and 185 various gateways, allowing hypermedia access to existing Internet 186 protocols like SMTP [14], NNTP [12], FTP [16], Gopher [2], and 187 WAIS [9]. HTTP/1.0 is designed to allow such gateways, via proxy 188 servers, without any loss of the data conveyed by those earlier 189 protocols. 191 1.2 Overall Operation 193 The HTTP protocol is based on a request/response paradigm. A 194 requesting program (termed a client) establishes a connection with 195 a receiving program (termed a server) and sends a request to the 196 server in the form of a request method, URI, and protocol version, 197 followed by a MIME-like message containing request modifiers, 198 client information, and possible body content. The server responds 199 with a status line (including its protocol version and a success or 200 error code), followed by a MIME-like message containing server 201 information, entity metainformation, and possible body content. It 202 should be noted that a given program may be capable of being both a 203 client and a server; our use of those terms refers only to the role 204 being performed by the program during a particular connection, 205 rather than to the program's purpose in general. 207 On the Internet, the communication generally takes place over a 208 TCP/IP connection. The default port is TCP 80 [17], but other ports 209 can be used. This does not preclude the HTTP/1.0 protocol from 210 being implemented on top of any other protocol on the Internet, or 211 on other networks. The mapping of the HTTP/1.0 request and response 212 structures onto the transport data units of the protocol in 213 question is outside the scope of this specification. 215 For most implementations, the connection is established by the 216 client prior to each request and closed by the server after sending 217 the response. However, this is not a feature of the protocol and is 218 not required by this specification. Both clients and servers must 219 be capable of handling cases where either party closes the 220 connection prematurely, due to user action, automated time-out, or 221 program failure. In any case, the closing of the connection by 222 either or both parties always terminates the current request, 223 regardless of its status. 225 1.3 Terminology 227 This specification uses a number of terms to refer to the roles 228 played by participants in, and objects of, the HTTP communication. 230 connection 231 A virtual circuit established between two parties for the 232 purpose of communication. 234 message 235 A structured sequence of octets transmitted via the connection 236 as the basic component of communication. 238 request 239 An HTTP request message (as defined in Section 5). 241 response 242 An HTTP response message (as defined in Section 6). 244 resource 245 A network data object or service which can be identified by a 246 URI. 248 entity 249 A particular representation or rendition of a resource that may 250 be enclosed within a request or response message. An entity 251 consists of metainformation (in the form of entity headers) and 252 content (in the form of an entity body). 254 client 255 A program that establishes connections for the purpose of 256 sending requests. 258 user agent 259 The client program which is closest to the user and which 260 initiates requests at their behest. 262 server 263 A program that accepts connections in order to service requests 264 by sending back responses. 266 origin server 267 The server on which a given resource resides or is to be created. 269 proxy 270 An intermediary program which acts as both a server and a client 271 for the purpose of forwarding requests. Proxies are often used 272 to act as a portal through a network firewall. A proxy server 273 accepts requests from other clients and services them either 274 internally or by passing them (with possible translation) on to 275 other servers. A caching proxy is a proxy server with a local 276 cache of server responses -- some requested resources can be 277 serviced from the cache rather than from the origin server. Some 278 proxy servers also act as origin servers. 280 gateway 281 A proxy which services HTTP requests by translation into 282 protocols other than HTTP. The reply sent from the remote server 283 to the gateway is likewise translated into HTTP before being 284 forwarded to the user agent. 286 2. Notational Conventions and Generic Grammar 288 2.1 Augmented BNF 290 All of the mechanisms specified in this document are described in 291 both prose and an augmented Backus-Naur Form (BNF) similar to that 292 used by RFC 822 [8]. Implementors will need to be familiar with the 293 notation in order to understand this specification. The augmented 294 BNF includes the following constructs: 296 name = definition 298 The name of a rule is simply the name itself (without any 299 enclosing "<" and ">") and is separated from its definition by 300 the equal character "=". Whitespace is only significant in that 301 indentation of continuation lines is used to indicate a rule 302 definition that spans more than one line. Certain basic rules 303 are in uppercase, such as SP, LWS, HTAB, CRLF, DIGIT, ALPHA, 304 etc. Angle brackets are used within definitions whenever their 305 presence will facilitate discerning the use of rule names. 307 "literal" 309 Quotation marks surround literal text. Unless stated otherwise, 310 the text is case-insensitive. 312 rule1 | rule2 314 Elements separated by a bar ("I") are alternatives, 315 e.g. "yes | no" will accept yes or no. 317 (rule1 rule2) 319 Elements enclosed in parentheses are treated as a single 320 element. Thus,"(elem (foo | bar) elem)" allows the token 321 sequences "elem foo elem" and "elem bar elem". 323 *rule 325 The character "*" preceding an element indicates repetition. The 326 full form is "*element" indicating at least and at 327 most occurrences of element. Default values are 0 and 328 infinity so that "*(element)" allows any number, including zero; 329 "1*element" requires at least one; and "1*2element" allows one 330 or two. 332 [rule] 334 Square brackets enclose optional elements; "[foo bar]" is 335 equivalent to "*1(foo bar)". 337 N rule 339 Specific repetition: "(element)" is equivalent to 340 "*(element)"; that is, exactly occurrences of 341 (element). Thus 2DIGIT is a 2-digit number, and 3ALPHA is a 342 string of three alphabetic characters. 344 #rule 346 A construct "#" is defined, similar to "*", for defining lists 347 of elements. The full form is "#element" indicating at 348 least and at most elements, each separated by one or 349 more commas (",") and optional linear whitespace (LWS). This 350 makes the usual form of lists very easy; a rule such as 351 "( *LWS element *( *LWS "," *LWS element ))" can be shown as 352 "1#element". Wherever this construct is used, null elements are 353 allowed, but do not contribute to the count of elements present. 354 That is, "(element), , (element)" is permitted, but counts as 355 only two elements. Therefore, where at least one element is 356 required, at least one non-null element must be present. Default 357 values are 0 and infinity so that "#(element)" allows any 358 number, including zero; "1#element" requires at least one; and 359 "1#2element" allows one or two. 361 ; comment 363 A semi-colon, set off some distance to the right of rule text, 364 starts a comment that continues to the end of line. This is a 365 simple way of including useful notes in parallel with the 366 specifications. 368 implied *LWS 370 The grammar described by this specification is word-based. 371 Except where noted otherwise, zero or more linear whitespace 372 (LWS) can be included between any two words (token or 373 quoted-string) without changing the interpretation of a field. 374 However, applications should attempt to follow "common form" 375 when generating HTTP constructs, since there exist some 376 implementations that fail to accept anything beyond the common 377 forms. 379 2.2 Basic Rules 381 The following rules are used throughout this specification to 382 describe basic parsing constructs. The US-ASCII character set is 383 defined by [18]. 385 OCTET = 386 CHAR = 387 UPALPHA = 388 LOALPHA = 389 ALPHA = UPALPHA | LOALPHA 390 DIGIT = 391 CTL = 393 CR = 394 LF = 395 SP = 396 HTAB = 397 <"> = 399 HTTP/1.0 defines the octet sequence CR LF as the end-of-line marker 400 for all protocol elements except the Entity-Body (see Appendix C 401 for tolerant applications). The end-of-line marker for an 402 Entity-Body is defined by its associated media type, as described 403 in Section 8.1. 405 CRLF = CR LF 407 HTTP/1.0 headers can be folded onto multiple lines if the 408 continuation lines begin with linear whitespace characters. All 409 linear whitespace (including folding) has the same semantics as SP. 411 LWS = [CRLF] 1*( SP | HTAB ) 413 Many HTTP/1.0 header field values consist of words separated by LWS 414 or special characters. These special characters must be in a quoted 415 string to be used within a parameter value. 417 word = token | quoted-string 419 token = 1* 421 tspecials = "(" | ")" | "<" | ">" | "@" 422 | "," | ";" | ":" | "\" | <"> 423 | "/" | "[" | "]" | "?" | "=" 424 | SP | HTAB 426 A string of text is parsed as a single word if it is quoted using 427 double-quote marks or angle brackets. 429 quoted-string = ( <"> *(qdtext) <"> ) 430 | ( "<" *(qatext) ">" ) 432 qdtext = and CTLs, 433 but including LWS> 435 qatext = ", and CTLs, 436 but including LWS> 438 The text rule is only used for descriptive field contents. Words of 439 *text may contain characters from character sets other than 440 US-ASCII only when encoded according to the rules of RFC 1522 [13]. 442 text = 445 3. Protocol Parameters 447 3.1 HTTP Version 449 HTTP uses a "." numbering scheme to indicate versions 450 of the protocol. The protocol versioning policy is intended to 451 allow the sender to indicate the format of a message and its 452 capacity for understanding further HTTP communication, rather than 453 the features obtained via that communication. No change is made to 454 the version number for the addition of message components which do 455 not affect communication behavior or which only add to extensible 456 field values. The number is incremented when the changes 457 made to the protocol add features which do not change the general 458 message parsing algorithm, but which may add to the message 459 semantics and imply additional capabilities of the sender. The 460 number is incremented when the format of a message within 461 the protocol is changed. 463 The version of an HTTP message is indicated by an HTTP-Version 464 field in the first line of the message. If the protocol version is 465 not specified, the recipient must assume that the message is in the 466 simple HTTP/0.9 format. 468 HTTP-Version = "HTTP" "/" 1*DIGIT "." 1*DIGIT 470 Note that the major and minor numbers should be treated as separate 471 integers and that each may be incremented higher than a single 472 digit. Thus, HTTP/2.4 is a lower version than HTTP/2.13, which in 473 turn is lower than HTTP/12.3. Leading zeroes should be ignored by 474 recipients and never generated by senders. 476 This document defines both the 0.9 and 1.0 versions of the HTTP 477 protocol. Applications sending Full-Request or Full-Response 478 messages, as defined by this specification, must include an 479 HTTP-Version of "HTTP/1.0". 481 HTTP servers are required to be able to recognize the format of the 482 Request-Line for all lower-version requests, understand requests 483 with a format within one major number of their native version (i.e. 484 and ), and respond appropriately with a message 485 within the same protocol number (even if the response is 486 simply an error message). HTTP clients are required to be able to 487 recognize the format of the Status-Line for all lower-version 488 responses and understand responses with a format within one major 489 number of their request version. The following hypothetical example 490 illustrates the required behavior. 492 o A valid HTTP/3.5 request is received and the server's native 493 protocol version is 495 o Less than 3.0: it should attempt to understand the request 496 and respond (possibly with an error) in its native format; 498 o Major number of 3: It should understand the request and 499 respond in its native format; 501 o Major number of 4: It should understand the request and 502 respond with a version 3 message; 504 o Major number higher than 4: It should attempt to understand 505 the request and respond (possibly with an error) with a 506 version 3 message; 508 o User agent receives a response to an HTTP/3.5 request, and the 509 response version is 511 o Less than 2.0: It should attempt to understand the response 512 and unobtrusively warn the user of the version mismatch; 514 o 2.0--3.4: It should understand the response and be aware 515 that its request may not have been fully understood by the 516 server; 518 o 3.5 or higher 3: It should understand the response and can 519 assume that the server understood all aspects of the request 520 if the response does not indicate an error; 522 o 4.0 or higher: It should attempt to understand the response 523 and unobtrusively warn the user of the version mismatch. 525 Proxies must be careful in forwarding requests that are received in 526 a format different than that of the proxy's native version. Since 527 the protocol version indicates the protocol capability of the 528 sender, a proxy must never send a message with a version indicator 529 which is greater than its native version; if a higher version 530 request is received, the proxy must either downgrade the request 531 version or respond with an error. Requests with a version lower 532 than that of the proxy's native format may be upgraded by the proxy 533 before being forwarded; the proxy's response to that request must 534 follow the normal server requirements. 536 3.2 Universal Resource Identifiers 538 This section is To-Be-Specified. It will contain a brief 539 description of URIs as defined by RFC 1630, including mention of 540 the allowed characters and the hex encoding, and provide a full 541 definition of the http URL scheme. 543 URI = 545 All URI protocol elements must be encoded using the escaping scheme 546 described in RFC 1630 [3]. 548 3.3 Date/Time Formats 550 3.3.1 Full Date 552 HTTP/1.0 applications have historically allowed three different 553 formats for the representation of date/time stamps: 555 Sun, 06 Nov 1994 08:49:37 GMT ; RFC 822, updated by RFC 1123 556 Sunday, 06-Nov-94 08:49:37 GMT ; RFC 850, obsoleted by RFC 1036 557 Sun Nov 6 08:49:37 1994 ; ANSI C's asctime() format 559 The first format is preferred as an Internet standard and 560 represents a fixed-length subset of that defined by RFC 1123 [7] 561 (an update to RFC 822 [8]). The second format is in common use, but 562 is based on the obsolete RFC 850 [11] date format and lacks a four- 563 digit year. HTTP/1.0 clients and servers must accept all three 564 formats, though they should never generate the third (asctime) 565 format. Future clients and servers must only generate the RFC 1123 566 format for representing date/time stamps in HTTP/1.0 requests and 567 responses. 569 All HTTP/1.0 date/time stamps must be represented in Universal Time 570 (UT), also known as Greenwich Mean Time (GMT), without exception. 571 This is indicated in the first two formats by the inclusion of 572 "GMT" as the three-letter abbreviation for time zone, and should be 573 assumed when reading the asctime format. 575 HTTP-date = rfc1123-date | rfc850-date | asctime-date 577 rfc1123-date = wkday "," SP date1 SP time SP "GMT" 578 rfc850-date = weekday "," SP date2 SP time SP "GMT" 579 asctime-date = wkday SP date3 SP time SP 4DIGIT 581 date1 = 2DIGIT SP month SP 4DIGIT 582 ; day month year (e.g. 02 Jun 1982) 583 date2 = 2DIGIT "-" month "-" 2DIGIT 584 ; day-month-year (e.g. 02-Jun-82) 585 date3 = month SP ( 2DIGIT | ( SP 1DIGIT )) 586 ; month day (e.g. Jun 2) 588 time = 2DIGIT ":" 2DIGIT ":" 2DIGIT 589 ; 00:00:00 - 23:59:59 591 wkday = "Mon" | "Tue" | "Wed" 592 | "Thu" | "Fri" | "Sat" | "Sun" 594 weekday = "Monday" | "Tuesday" | "Wednesday" 595 | "Thursday" | "Friday" | "Saturday" | "Sunday" 597 month = "Jan" | "Feb" | "Mar" | "Apr" 598 | "May" | "Jun" | "Jul" | "Aug" 599 | "Sep" | "Oct" | "Nov" | "Dec" 601 Comments and/or extra LWS are not permitted inside an HTTP-date 602 value generated by a conformant application. However, recipients of 603 date values should be robust in accepting date values that may have 604 been generated by non-HTTP applications (as is sometimes the case 605 when retrieving or posting messages via gateways to SMTP or NNTP). 607 Note: HTTP/1.0 requirements for the date/time stamp format 608 apply only to their usage within the protocol stream. 609 Clients and servers are not required to use these formats 610 for user presentation, request logging, etc. 612 3.3.2 Delta Seconds 614 Some HTTP header fields allow a time value to be specified as an 615 integer number of seconds (represented in decimal) after the time 616 that the message was received. This format should only be used to 617 represent short time periods or periods that cannot start until 618 receipt of the message. 620 delta-seconds = 1*DIGIT 622 4. HTTP Message 624 4.1 Message Types 626 HTTP messages consist of requests from client to server and 627 responses from server to client. 629 HTTP-message = Simple-Request ; HTTP/0.9 messages 630 | Simple-Response 631 | Full-Request ; HTTP/1.0 messages 632 | Full-Response 634 Full-Request and Full-Response use the generic message format of 635 RFC 822 [8] for transferring entities. Both messages may include 636 optional header fields (a.k.a. "headers") and an entity body. The 637 entity body is separated from the headers by a null line (i.e., a 638 line with nothing preceding the CRLF). 640 Full-Request = Request-Line ; Section 5.1 641 *( General-Header ; Section 4.3 642 | Request-Header ; Section 5.4 643 | Entity-Header ) ; Section 7.1 644 CRLF 645 [ Entity-Body ] ; Section 7.2 647 Full-Response = Status-Line ; Section 6.1 648 *( General-Header ; Section 4.3 649 | Response-Header ; Section 6.3 650 | Entity-Header ) ; Section 7.1 651 CRLF 652 [ Entity-Body ] ; Section 7.2 654 Simple-Request and Simple-Response do not allow the use of any 655 header information and are limited to a single request method (GET). 657 Simple-Request = "GET" SP Request-URI CRLF 659 Simple-Response = [ Entity-Body ] 661 Use of the Simple-Request format is discouraged because it prevents 662 the client from using content negotiation and the server from 663 identifying the media type of the returned entity. 665 4.2 Message Headers 667 HTTP header fields, which include General-Header (Section 4.3), 668 Request-Header (Section 5.4), Response-Header (Section 6.3), and 669 Entity-Header (Section 7.1) fields, follow the same generic format 670 as that given in Section 3.1 of RFC 822 [8]. Each header field 671 consists of a name followed by a colon (":") and the field value. 672 The field value may be preceded by any amount of LWS, though a 673 single SP is preferred. Header fields can be extended over multiple 674 lines by preceding each extra line with at least one LWS. 676 HTTP-header = field-name ":" [ field-value ] CRLF 678 field-name = 1* 679 field-value = *( field-content | comment | LWS ) 681 field-content = 685 The order in which header fields are received is not significant. 686 However, it is considered "good practice" to send General-Header 687 fields first, followed by Request-Header or Response-Header fields 688 prior to the Entity-Header fields. Comments can be included in HTTP 689 header fields by surrounding the comment text with parentheses. 691 comment = "(" *( ctext | comment ) ")" 692 ctext = 694 Note: Use of comments within HTTP headers is generally 695 discouraged, since they are rarely seen by human eyes and 696 hence only increase network traffic. However, they may be 697 useful for messages posted or retrieved via NNTP and SMTP 698 gateways. 700 4.3 General Message Header Fields 702 There are a few header fields which have general applicability for 703 both request and response messages, but which do not apply to the 704 communicating parties or the entity being transferred. Although 705 none of the General-Header fields are required, they are all 706 strongly recommended where their use is appropriate, and should be 707 understood by all future HTTP/1.0 clients and servers. These 708 headers apply only to the message being transmitted. 710 General-Header = Date 711 | Forwarded 712 | Message-ID 713 | MIME-Version 714 | extension-header 716 Although additional general header fields may be implemented via 717 the extension mechanism, applications which do not recognize those 718 fields should treat them as Entity-Header fields. 720 4.3.1 Date 722 The Date header represents the date and time at which the message 723 was originated, having the same semantics as orig-date in RFC 724 822. The field value is an HTTP-date, as described in Section 3.3. 726 Date = "Date" ":" HTTP-date 728 An example is 730 Date: Tue, 15 Nov 1994 08:12:31 GMT 732 If a message is received via direct connection with the user agent 733 (in the case of requests) or the origin server (in the case of 734 responses), then the default date can be assumed to be the current 735 date at the receiving end. However, since the date--as it is 736 believed by the origin--is important for evaluating cached 737 responses, origin servers should always include a Date header. 738 Clients should only send a Date header field in messages that 739 include an entity body, as in the case of the PUT and POST 740 requests, and even then it is optional. A received message which 741 does not have a Date header field should be assigned one by the 742 receiver if and only if the message will be cached by that receiver 743 or gatewayed via a protocol which requires a Date. 745 Only one Date header field is allowed per message. In theory, the 746 date should represent the moment just before the status/request- 747 line is generated (i.e. the time at which the originator made the 748 determination of what the request/response should be). In practice, 749 the date can be generated at any time during the message 750 origination without affecting its semantic value. 752 Note: An earlier version of this document incorrectly 753 specified that this field should contain the creation date 754 of the enclosed Entity-Body. This has been changed to 755 reflect actual (and proper) usage. 757 4.3.2 Forwarded 759 The Forwarded header is to be used by proxies to indicate the 760 intermediate steps between the user agent and the server (on 761 requests) and between the origin server and the client (on 762 responses). It is analogous to the "Received" field of RFC 822 and 763 is intended to be used for tracing transport problems and avoiding 764 request loops. 766 Forwarded = "Forwarded" ":" "by" URI [ "(" product ")" ] 767 [ "for" FQDN ] 769 FQDN = 771 For example, a message could be sent from a client on 772 ptsun00.cern.ch to a server at www.ics.uci.edu port 80, via an 773 intermediate HTTP proxy at info.cern.ch port 8000. The request 774 received by the server at www.ics.uci.edu would then have the 775 following Forwarded header field: 777 Forwarded: by http://info.cern.ch:8000/ for ptsun00.cern.ch 779 Multiple Forwarded header fields are allowed and should represent 780 each proxy that has forwarded the message. It is strongly 781 recommended that proxies used as a portal through a network 782 firewall do not, by default, send out information about the 783 internal hosts within the firewall region. This information should 784 only be propagated if explicitly enabled. If not enabled, the for 785 token and FQDN should not be included in the field value. 787 4.3.3 Message-ID 789 The Message-ID field in HTTP is identical to that used by Internet 790 Mail and USENET messages, as defined in [11]. That is, it gives the 791 message a single, unique identifier which can be used for 792 identifying the message (not its contents) for "much longer" than 793 the expected lifetime of that message. 795 Message-ID = "Message-ID" ":" "<" addr-spec ">" 796 addr-spec = 798 Although it is not required, the addr-spec format typically used 799 within a Message-ID consists of a string that is unique at the 800 originator's machine, followed by the required "@" character and 801 the fully-qualified domain name of that machine. An example is 803 Message-ID: <9411151630.4256@info.cern.ch> 805 which is composed using the time, date and process-ID on the host 806 info.cern.ch. However, this is only one of many possible methods 807 for generating a unique Message-ID and recipients of a message 808 should consider the entire value opaque. 810 The Message-ID field is normally not generated by HTTP applications 811 and is never required. It should only be generated by a gateway 812 application when the message is being posted to some other protocol 813 that desires a Message-ID. HTTP responses should only include a 814 Message-ID header field when the entity being transferred already 815 has one assigned to it (as in the case of resources that were 816 originally posted via Internet Mail or USENET). 818 4.3.4 MIME-Version 820 HTTP is not a MIME-conformant protocol. However, HTTP/1.0 messages 821 may include a single MIME-Version header field to indicate what 822 version of the MIME protocol was used to construct the message. Use 823 of the MIME-Version header field should indicate that the message 824 is in full compliance with the MIME protocol (as defined in [6]). 825 Unfortunately, current versions of HTTP/1.0 clients and servers use 826 this field indiscriminately, and thus receivers must not take it 827 for granted that the message is indeed in full compliance with 828 MIME. Gateways are responsible for ensuring this compliance (where 829 possible) when exporting HTTP messages to strict MIME environments. 830 Future HTTP/1.0 applications must only use MIME-Version when the 831 message is intended to be MIME-conformant. 833 MIME-Version = "MIME-Version" ":" 1*DIGIT "." 1*DIGIT 835 MIME version "1.0" is the default for use in HTTP/1.0. However, 836 HTTP/1.0 message parsing and semantics are defined by this document 837 and not the MIME specification. 839 5. Request 841 A request message from a client to a server includes, within the 842 first line of that message, the method to be applied to the 843 resource requested, the identifier of the resource, and the 844 protocol version in use. For backwards compatibility with the more 845 limited HTTP/0.9 protocol, there are two valid formats for an HTTP 846 request: 848 Request = Simple-Request | Full-Request 850 Simple-Request = "GET" SP Request-URI CRLF 852 Full-Request = Request-Line ; Section 5.1 853 *( General-Header ; Section 4.3 854 | Request-Header ; Section 5.4 855 | Entity-Header ) ; Section 7.1 856 CRLF 857 [ Entity-Body ] ; Section 7.2 859 If an HTTP/1.0 server receives a Simple-Request, it must respond 860 with an HTTP/0.9 Simple-Response. An HTTP/1.0 client capable of 861 receiving a Full-Response should never generate a Simple-Request. 863 5.1 Request-Line 865 The Request-Line begins with a method token, followed by the 866 Request-URI and the protocol version, and ending with CRLF. The 867 elements are separated by SP characters. No CR or LF are allowed 868 except in the final CRLF sequence. 870 Request-Line = Method SP Request-URI SP HTTP-Version CRLF 872 Note that the difference between a Simple-Request and the Request- 873 Line of a Full-Request is the presence of the HTTP-Version field. 875 5.2 Method 877 The Method token indicates the method to be performed on the 878 resource identified by the Request-URI. The method is case- 879 sensitive and extensible. 881 Method = "GET" | "HEAD" | "PUT" | "POST" 882 | "DELETE" | "LINK" | "UNLINK" 883 | extension-method 885 extension-method = token 887 The list of methods acceptable by a specific resource can be 888 specified in an "Allow" Entity-Header (Section 7.1.1). However, the 889 client is always notified through the return code of the response 890 whether a method is currently allowed on a specific resource, as 891 this can change dynamically. Servers should return the status code 892 "405 Method Not Allowed" if the method is known by the server but 893 not allowed for the requested resource, and "501 Not Implemented" 894 if the method is unknown or not implemented by the server. 896 The set of common methods for HTTP/1.0 is described below. Although 897 this set can be easily expanded, additional methods cannot be 898 assumed to share the same semantics for separately extended clients 899 and servers. In order to maintain compatibility, the semantic 900 definition for extension methods should be registered with the 901 IANA [17]. 903 5.2.1 GET 905 The GET method means retrieve whatever information (in the form of 906 an entity) is identified by the Request-URI. If the Request-URI 907 refers to a data-producing process, it is the produced data which 908 shall be returned as the entity in the response and not the source 909 text of the process (unless that text happens to be the output of 910 the process). 912 The semantics of the GET method changes to a "conditional GET" if 913 the request message includes an If-Modified-Since header field. A 914 conditional GET method requests that the identified resource be 915 transferred only if it has been modified since the date given by 916 the If-Modified-Since header. The algorithm for determining this 917 includes the following cases: 919 a) If the request would normally result in anything other than 920 a "200 OK" status, or if the passed If-Modified-Since date 921 is invalid, the response is exactly the same as for a 922 normal GET. 924 b) If the resource has been modified since the If-Modified- 925 Since date, the response is exactly the same as for a 926 normal GET. 928 c) If the resource has not been modified since the If-Modified- 929 Since date, the server shall return a "304 Not Modified" 930 response. 932 The conditional GET method is intended to reduce network usage by 933 allowing cached entities to be refreshed without requiring multiple 934 requests or transferring unnecessary data. 936 5.2.2 HEAD 938 The HEAD method is identical to GET except that the server must not 939 return any Entity-Body in the response. The metainformation 940 contained in the HTTP headers in response to a HEAD request should 941 be identical to the information sent in response to a GET request. 942 This method can be used for obtaining metainformation about the 943 resource identified by the Request-URI without transferring the 944 Entity-Body itself. This method is often used for testing hypertext 945 links for validity, accessibility, and recent modification. 947 There is no "conditional HEAD" requests analogous to the 948 conditional GET. If an If-Modified-Since header field is included 949 with a HEAD request, it should be ignored. 951 5.2.3 POST 953 The POST method is used to request that the destination server 954 accept the entity enclosed in the request as a new subordinate of 955 the resource identified by the Request-URI in the Request-Line. 956 POST is designed to allow a uniform method to cover the following 957 functions: 959 o Annotation of existing resources; 961 o Posting a message to a bulletin board, newsgroup, mailing list, 962 or similar group of articles; 964 o Providing a block of data (usually a form) to a data-handling 965 process; 967 o Extending a database through an append operation. 969 The actual function performed by the POST method is determined by 970 the server and is usually dependent on the Request-URI. The posted 971 entity is considered to be subordinate to that URI in the same way 972 that a file is subordinate to a directory containing it, a news 973 article is subordinate to a newsgroup to which it is posted, or a 974 record is subordinate to a database. 976 The client can suggest a URI for identifying the new resource by 977 including a URI-header field in the request. However, the server 978 should treat that URI as advisory only and may store the entity 979 under a different URI or without any URI. 981 The client may apply relationships between the new resource and 982 other existing resources by including Link header fields, as 983 described in Section 7.1.10. The server may use the Link 984 information to perform other operations as a result of the new 985 resource being added. For example, lists and indexes might be 986 updated. However, no mandatory operation is imposed on the origin 987 server. The origin server may also generate its own or additional 988 links to other resources. 990 A successful POST does not require that the entity be created as a 991 resource on the origin server or made accessible for future 992 reference. That is, the action performed by the POST method might 993 not result in a resource that can be identified by a URI. In this 994 case, either "200 OK" or "204 No Content" is the appropriate 995 response status, depending on whether or not the response includes 996 an entity that describes the result. 998 If a resource has been created on the origin server, the response 999 should be "201 Created" and contain the allocated URI, all 1000 applicable Link header fields, and an entity (preferably of type 1001 "text/html") which describes the status of the request and refers 1002 to the new resource. 1004 5.2.4 PUT 1006 The PUT method requests that the enclosed entity be stored under 1007 the supplied Request-URI. If the Request-URI refers to an already 1008 existing resource, the enclosed entity should be considered a 1009 modified version of the one residing on the origin server. If the 1010 Request-URI does not point to an existing resource, and that URI is 1011 capable of being defined as a new resource by the requesting user 1012 agent, the origin server can create the resource with that URI. If 1013 a new resource is created, the origin server must inform the user 1014 agent via the "201 Created" response. If an existing resource is 1015 modified, the "200 OK" response should be sent to indicate 1016 successful completion of the request. If the resource could not be 1017 created or modified with the Request-URI, an appropriate error 1018 response should be given that reflects the nature of the problem. 1020 The fundamental difference between the POST and PUT requests is 1021 reflected in the different meaning of the Request-URI. The URI in a 1022 POST request identifies the resource that will handle the enclosed 1023 entity as an appendage. That resource may be a data-accepting 1024 process, a gateway to some other protocol, or a separate entity 1025 that accepts annotations. In contrast, the URI in a PUT request 1026 identifies the entity enclosed with the request. The requestor of a 1027 PUT knows what URI is intended and the receiver must not attempt to 1028 apply the request to some other resource. If the receiver desires 1029 that the request be applied to a different URI, it must send a 1030 "301 Moved Permanently" response; the requestor may then make its 1031 own decision regarding whether or not to redirect the request. 1033 The client can create or modify relationships between the enclosed 1034 entity and other existing resources by including Link header 1035 fields, as described in Section 7.1.10. As with POST, the server 1036 may use the Link information to perform other operations as a 1037 result of the request. However, no mandatory operation is imposed 1038 on the origin server. The origin server may generate its own or 1039 additional links to other resources. 1041 The actual method for determining how the resource is placed, and 1042 what happens to its predecessor, is defined entirely by the origin 1043 server. If version control is implemented by the origin server, the 1044 Version and Derived-From header fields should be used to help 1045 identify and control revisions to a resource. 1047 5.2.5 DELETE 1049 The DELETE method requests that the origin server delete the 1050 resource identified by the Request-URI. This method may be 1051 overridden by human intervention (or other means) on the origin 1052 server. The client cannot be guaranteed that the operation has been 1053 carried out, even if the status code returned from the origin 1054 server indicates that the action has been completed successfully. 1055 However, the server should not indicate success unless, at the time 1056 the response is given, it intends to delete the resource or move it 1057 to an inaccessible location. 1059 A successful response should be "200 OK" (if the response includes 1060 an entity describing the status), "202 Accepted" (if the action has 1061 not yet been enacted), or "204 No Content" (if the response is OK 1062 but does not include an entity). 1064 5.2.6 LINK 1066 The LINK method establishes one or more Link relationships between 1067 the existing resource identified by the Request-URI and other 1068 existing resources. The difference between LINK and other methods 1069 allowing links to be established between resources is that the LINK 1070 method does not allow any Entity-Body to be sent in the request and 1071 does not result in the creation of new resources. 1073 5.2.7 UNLINK 1075 The UNLINK method removes one or more Link relationships from the 1076 existing resource identified by the Request-URI. These 1077 relationships may have been established using the LINK method or by 1078 any other method supporting the Link header. The removal of a link 1079 to a resource does not imply that the resource ceases to exist or 1080 becomes inaccessible for future references. 1082 5.3 Request-URI 1084 The Request-URI is a Universal Resource Identifier (Section 3.2) 1085 and identifies the resource upon which to apply the request. 1087 Request-URI = URI 1089 Unless the server is being used as a proxy, a partial URI shall be 1090 given with the assumptions of the scheme (http) and hostname:port 1091 (the server's address) being obvious. That is, if the full URI 1092 looks like 1094 http://info.cern.ch/hypertext/WWW/TheProject.html 1096 then the corresponding partial URI in the Simple-Request or 1097 Full-Request is 1099 /hypertext/WWW/TheProject.html 1101 If the client is sending the request through a proxy, the absolute 1102 form of the URI (including scheme and server address) must be used. 1103 A proxy must be able to recognize all of its server names, 1104 including any aliases, local variations, and the numeric IP address. 1106 5.4 Request Header Fields 1108 The request header fields allow the client to pass additional 1109 information about the request (and about the client itself) to the 1110 server. All header fields are optional and conform to the generic 1111 HTTP-header syntax. 1113 Request-Header = Accept 1114 | Accept-Charset 1115 | Accept-Encoding 1116 | Accept-Language 1117 | Authorization 1118 | From 1119 | If-Modified-Since 1120 | Pragma 1121 | Referer 1122 | User-Agent 1123 | extension-header 1125 Although additional request header fields may be implemented via 1126 the extension mechanism, applications which do not recognize those 1127 fields should treat them as Entity-Header fields. 1129 5.4.1 Accept 1131 The Accept header field can be used to indicate a list of media 1132 ranges which are acceptable as a response to the request. The 1133 asterisk "*" character is used to group media types into ranges, 1134 with "*/*" indicating all media types and "type/*" indicating all 1135 subtypes of that type. The set of ranges given by the client should 1136 represent what types are acceptable given the context of the 1137 request. The Accept field should only be used when the request is 1138 specifically limited to a set of desired types (as in the case of a 1139 request for an in-line image), to indicate qualitative preferences 1140 for specific media types, or to indicate acceptance of unusual 1141 media types. 1143 The field may be folded onto several lines and more than one 1144 occurrence of the field is allowed (with the semantics being the 1145 same as if all the entries had been in one field value). 1147 Accept = "Accept" ":" 1#( 1148 media-range 1149 [ ";" "q" "=" ( "0" | "1" | float ) ] 1150 [ ";" "mxb" "=" 1*DIGIT ] ) 1152 media-range = ( "*/*" 1153 | ( type "/" "*" ) 1154 | ( type "/" subtype ) 1155 ) *( ";" parameter ) 1157 float = < ANSI-C floating point text representation, 1158 where (0.0 < float < 1.0) > 1160 The parameter q is used to indicate the quality factor, which 1161 represents the user's preference for that range of media types, and 1162 the parameter mxb gives the maximum acceptable size of the Entity- 1163 Body (in decimal number of octets) for that range of media types. 1164 Section 9 describes the content negotiation algorithm which makes 1165 use of these values. If at least one Accept header is present, a 1166 quality factor of 0 is equivalent to not sending an Accept header 1167 field containing that media-type or set of media-types. The default 1168 values are: q=1 and mxb=undefined (i.e. infinity). 1170 The example 1172 Accept: audio/*; q=0.2, audio/basic 1174 should verbally be interpreted as "if you have audio/basic, send 1175 it; otherwise send me any audio type." 1177 If no Accept header is present, then it is assumed that the client 1178 accepts all media types with quality factor 1. This is equivalent 1179 to the client sending the following accept header field: 1181 Accept: */*; q=1 1183 or 1185 Accept: */* 1187 A more elaborate example is 1189 Accept: text/plain; q=0.5, text/html, 1190 text/x-dvi; q=0.8; mxb=100000, text/x-c 1192 Verbally, this would be interpreted as "text/html and text/x-c are 1193 the preferred media types, but if they do not exist then send the 1194 Entity-Body in text/x-dvi if the entity is less than 100000 bytes, 1195 otherwise send text/plain". 1197 Note: In earlier versions of this document, the mxs 1198 parameter defined the maximum acceptable delay in seconds 1199 before the response would arrive. This has been removed as 1200 the server has no means of obtaining a useful reference 1201 value. However, this does not prevent the client from 1202 internally measuring the response time and optimizing the 1203 Accept header field accordingly. 1205 It must be emphasized that this field should only be used when it 1206 is necessary to restrict the response media types to a subset of 1207 those possible, to indicate the acceptance of unusual media types, 1208 or when the user has been permitted to specify qualitative values 1209 for ranges of media types. If no quality factors have been set by 1210 the user, and the context of the request is such that the user 1211 agent is capable of saving the entity to a file if the received 1212 media type is unknown, then the only appropriate value for Accept 1213 is "*/*" and the list of unusual types. Whether or not a particular 1214 media type is deemed "unusual" should be a configurable aspect of 1215 the user agent. 1217 5.4.2 Accept-Charset 1219 The Accept-Charset header field can be used to indicate a list of 1220 preferred character sets other than the default US-ASCII and 1221 ISO-8859-1. This field allows clients capable of understanding more 1222 comprehensive or special-purpose character sets to signal that 1223 capability to a server which is capable of representing documents 1224 in those character sets. 1226 Accept-Charset = "Accept-Charset" ":" 1#charset 1228 Character set values are described in Section 8.3. An example is 1230 Accept-Charset: iso-8859-5, unicode-1-1 1232 The value of this field should not include "US-ASCII" or 1233 "ISO-8859-1", since those values are always assumed by default. If 1234 a resource is only available in a character set other than the 1235 defaults, and that character set is not listed in the Accept- 1236 Charset field, it is only acceptable for the server to send the 1237 entity if the character set can be identified by an appropriate 1238 charset parameter on the media type or within the format of the 1239 media type itself. 1241 Note: User agents are not required to be able to render the 1242 characters associated with the ISO-8859-1 character set. 1243 However, they must be able to interpret their meaning to 1244 whatever extent is required to properly handle messages in 1245 that character set.. 1247 5.4.3 Accept-Encoding 1249 The Accept-Encoding header field is similar to Accept, but lists 1250 the encoding-mechanisms and transfer-encoding values which are 1251 acceptable in the response. 1253 Accept-Encoding = "Accept-Encoding" ":" 1254 1#( encoding-mechanism | transfer-encoding ) 1256 An example of its use is 1258 Accept-Encoding: compress, base64, gzip, quoted-printable 1260 The field value should never include the identity transfer-encoding 1261 values ("7bit", "8bit", and "binary") since they actually represent 1262 "no encoding." If no Accept-Encoding field is present in a request, 1263 it must be assumed that the client does not accept any encoding- 1264 mechanism and only the identity transfer-encodings. 1266 5.4.4 Accept-Language 1268 The Accept-Language header field is similar to Accept, but lists 1269 the set of natural languages that are preferred as a response to 1270 the request. 1272 Accept-Language = "Accept-Language" ":" 1#language-tag 1274 The language-tag is described in Section 8.2. Languages are listed 1275 in the order of their preference to the user. For example, 1277 Accept-Language: dk, en-gb 1279 would mean: "Send me a Danish version if you have it; else a 1280 British English version." 1282 If the server cannot fulfill the request with one or more of the 1283 languages given, or if the languages only represent a subset of a 1284 multi-linguistic Entity-Body, it is acceptable to serve the request 1285 in an unspecified language. 1287 Note: As intelligibility is highly dependent on the 1288 individual user, it is recommended that client applications 1289 make the choice of linguistic preference available to the 1290 user. 1292 5.4.5 Authorization 1294 A user agent that wishes to authenticate itself with a server 1295 (usually, but not necessarily, after receiving a "401 Unauthorized" 1296 response), may do so by including an Authorization header field 1297 with the request. The Authorization field value consists of 1298 credentials containing the authentication information of the user 1299 agent for the realm of the resource being requested. 1301 Authorization = "Authorization" ":" credentials 1303 HTTP access authentication is described in Section 10. If a request 1304 is authenticated and a realm specified, the same credentials should 1305 be valid for all other requests within this realm. 1307 5.4.6 From 1309 The From header field, if given, should contain an Internet e-mail 1310 address for the human user who controls the requesting user agent. 1311 The address should be machine-usable, as defined by addr-spec in 1312 RFC 822: 1314 From = "From" ":" addr-spec 1316 An example is: 1318 From: webmaster@w3.org 1320 This header field may be used for logging purposes and as a means 1321 for identifying the source of invalid or unwanted requests. It 1322 should not be used as an insecure form of access protection. The 1323 interpretation of this field is that the request is being performed 1324 on behalf of the person given, who accepts responsibility for the 1325 method performed. In particular, robot agents should include this 1326 header so that the person responsible for running the robot can be 1327 contacted if problems occur on the receiving end. 1329 The Internet e-mail address in this field does not have to 1330 correspond to the Internet host which issued the request. (For 1331 example, when a request is passed through a proxy, then the 1332 original issuer's address should be used). The address should, if 1333 possible, be a valid Internet e-mail address, whether or not it is 1334 in fact an Internet e-mail address or the Internet e-mail 1335 representation of an address on some other mail system. 1337 Note: The client should not send the From header field 1338 without the user's approval, as it may conflict with the 1339 user's privacy interests or their site's security policy. It 1340 is strongly recommended that the user be able to disable, 1341 enable, and modify the value of this field at any time prior 1342 to a request. 1344 5.4.7 If-Modified-Since 1346 The If-Modified-Since header field is used with the GET method to 1347 make it conditional: if the requested resource has not been 1348 modified since the time specified in this field, a copy of the 1349 resource will not be returned from the server; instead, a "304 Not 1350 Modified" response will be returned without any Entity-Body. 1352 If-Modified-Since = "If-Modified-Since" ":" HTTP-date 1354 An example of the field is: 1356 If-Modified-Since: Sat, 29 Oct 1994 19:43:31 GMT 1358 The purpose of this feature is to allow efficient updates of local 1359 cache information with a minimum amount of transaction overhead. 1360 The same functionality can be obtained, though with much greater 1361 overhead, by issuing a HEAD request and following it with a GET 1362 request if the server indicates that the entity has been modified. 1364 5.4.8 Pragma 1366 The Pragma header field is used to specify directives that must be 1367 applied to all servers along the request chain (where relevant). 1368 The directives typically specify behavior that prevents 1369 intermediate proxies from changing the nature of the request. 1370 Although multiple pragma directives can be listed as part of the 1371 request, HTTP/1.0 only defines semantics for the 1372 "no-cache" directive. 1374 Pragma = "Pragma" ":" 1#pragma-directive 1376 pragma-directive = "no-cache" | extension-pragma 1377 extension-pragma = token 1379 When the "no-cache" directive is present, a caching proxy must 1380 forward the request toward the origin server even if it has a 1381 cached copy of what is being requested. This allows a client to 1382 insist upon receiving an authoritative response to its request. It 1383 also allows a client to refresh a cached copy which has become 1384 corrupted or is known to be stale. 1386 Pragmas must be passed through by a proxy even when they have 1387 significance to that proxy. This is necessary in cases when the 1388 request has to go through many proxies, and the pragma may affect 1389 all of them. It is not possible to specify a pragma for a specific 1390 proxy; however, any pragma-directive not relevant to a gateway or 1391 proxy should be ignored. 1393 5.4.9 Referer 1395 The Referer field allows the client to specify, for the server's 1396 benefit, the address (URI) of the document (or element within the 1397 document) from which the Request-URI was obtained. This allows a 1398 server to generate lists of back-links to documents, for interest, 1399 logging, optimized caching, etc. It also allows obsolete or 1400 mistyped links to be traced for maintenance. The format of the 1401 field is: 1403 Referer = "Referer" ":" URI 1405 Example: 1407 Referer: http://info.cern.ch/hypertext/DataSources/Overview.html 1409 If a partial URI is given, it should be interpreted relative to the 1410 Request-URI. 1412 Note: Because the source of a link may be considered private 1413 information or may reveal an otherwise secure information 1414 source, it is strongly recommended that the user be able to 1415 select whether or not the Referer field is sent. For 1416 example, a browser client could have a toggle switch for 1417 browsing openly/anonymously, which would respectively 1418 enable/disable the sending of Referer and From information. 1420 5.4.10 User-Agent 1422 The User-Agent field contains information about the user agent 1423 originating the request. This is for statistical purposes, the 1424 tracing of protocol violations, and automated recognition of user 1425 agents for the sake of tailoring responses to avoid particular user 1426 agent limitations. Although it is not required, user agents should 1427 always include this field with requests. The field can contain 1428 multiple tokens specifying the product name, with an optional slash 1429 and version designator, and other products which form a significant 1430 part of the user agent. By convention, the products are listed in 1431 order of their significance for identifying the application. 1433 User-Agent = "User-Agent" ":" 1*( product ) 1435 product = token ["/" product-version] 1436 product-version = token 1438 Example: 1440 User-Agent: CERN-LineMode/2.15 libwww/2.17b3 1442 Product tokens should be short and to the point -- use of this field 1443 for advertizing or other non-essential information is explicitly 1444 deprecated and will be considered as non-conformance to the 1445 protocol. Although any token character may appear in a 1446 product-version, this token should only be used for a version 1447 identifier (i.e., successive versions of the same product should 1448 only differ in the product-version portion of the product value). 1449 The User-Agent field may include additional information within 1450 comments that are not part of the value of the field. 1452 Note: Some current proxy applications append their product 1453 information to the list in the User-Agent field. This is no 1454 longer recommended, since it makes machine interpretation of 1455 these fields ambiguous. Instead, proxies should use the 1456 Forwarded header described in Section 4.3.2. 1458 6. Response 1460 After receiving and interpreting a request message, a server 1461 responds in the form of an HTTP response message. 1463 Response = Simple-Response | Full-Response 1465 Simple-Response= [ Entity-Body ] 1467 Full-Response = Status-Line ; Section 6.1 1468 *( General-Header ; Section 4.3 1469 | Response-Header ; Section 6.3 1470 | Entity-Header ) ; Section 7.1 1471 CRLF 1472 [ Entity-Body ] ; Section 7.2 1474 A Simple-Response should only be sent in response to an HTTP/0.9 1475 Simple-Request or if the server only supports the more limited 1476 HTTP/0.9 protocol. If a client sends an HTTP/1.0 Full-Request and 1477 receives a response that does not begin with a Status-Line, it 1478 should assume that the response is a Simple-Response and parse it 1479 accordingly. Note that the Simple-Response consists only of the 1480 entity body and is terminated by the server closing the connection. 1482 6.1 Status-Line 1484 The first line of a Full-Response message is the Status-Line, 1485 consisting of the protocol version followed by a numeric status 1486 code and its associated textual phrase, with each element separated 1487 by SP characters. No CR or LF is allowed except in the final CRLF 1488 sequence. 1490 Status-Line = HTTP-Version SP Status-Code SP Reason-Phrase CRLF 1492 Since a status line always begins with the protocol version's 1494 "HTTP/" 1*DIGIT "." 1*DIGIT 1496 (e.g. "HTTP/1.0"), the presence of that expression is considered 1497 sufficient to differentiate a Full-Response from a Simple-Response. 1498 Although the Simple-Response format may allow such an expression to 1499 occur at the beginning of an entity body (and thus cause a 1500 misinterpretation of the message if it was given in response to a 1501 Full-Request), the likelihood of such an occurrence is negligible. 1503 6.2 Status Codes and Reason Phrases 1505 The Status-Code element is a 3-digit integer result code of the 1506 attempt to understand and satisfy the request. The Reason-Phrase is 1507 intended to give a short textual description of the Status-Code. 1508 The Status-Code is intended for use by automata and the Reason- 1509 Phrase is intended for the human user. The client is not required 1510 to examine or display the Reason-Phrase. 1512 The first digit of the Status-Code defines the class of response. 1513 The last two digits do not have any categorization role. There are 1514 5 values for the first digit: 1516 o 1xx: Informational - Not used, but reserved for future use 1518 o 2xx: Success - The action was successfully received, 1519 understood, and accepted. 1521 o 3xx: Redirection - Further action must be taken in order to 1522 complete the request 1524 o 4xx: Client Error - The request contains bad syntax or cannot 1525 be fulfilled 1527 o 5xx: Server Error - The server failed to fulfill an apparently 1528 valid request 1530 The individual values of the numeric status codes defined for 1531 HTTP/1.0, and an example set of corresponding Reason-Phrase's, are 1532 presented below. The reason phrases listed here are only 1533 recommended -- they may be replaced by local equivalents without 1534 affecting the protocol. 1536 Status-Code = "200" ; OK 1537 | "201" ; Created 1538 | "202" ; Accepted 1539 | "203" ; Provisional Information 1540 | "204" ; No Content 1541 | "300" ; Multiple Choices 1542 | "301" ; Moved Permanently 1543 | "302" ; Moved Temporarily 1544 | "303" ; Method 1545 | "304" ; Not Modified 1546 | "400" ; Bad Request 1547 | "401" ; Unauthorized 1548 | "402" ; Payment Required 1549 | "403" ; Forbidden 1550 | "404" ; Not Found 1551 | "405" ; Method Not Allowed 1552 | "406" ; None Acceptable 1553 | "407" ; Proxy Authentication Required 1554 | "408" ; Request Timeout 1555 | "409" ; Conflict 1556 | "410" ; Gone 1557 | "500" ; Internal Server Error 1558 | "501" ; Not Implemented 1559 | "502" ; Bad Gateway 1560 | "503" ; Service Unavailable 1561 | "504" ; Gateway Timeout 1562 | extension-code 1564 extension-code = 3DIGIT 1566 Reason-Phrase = token *( SP token ) 1568 HTTP status codes are extensible and should be registered with the 1569 IANA. HTTP applications are not required to understand the meaning 1570 of all registered status codes, though such understanding is 1571 obviously desirable. However, applications are required to 1572 understand the class of any status code (as indicated by the first 1573 digit) and to treat the response as being equivalent to the x00 1574 status code of that class. For example, if an unknown status code 1575 of 421 is received by the client, it can safely assume that there 1576 was something wrong with its request and treat the response as if 1577 it had received a 400 status code. In such cases, user agents are 1578 encouraged to present the entity returned with the response to the 1579 user, since that entity is likely to include human-readable 1580 information which will explain the unusual status. 1582 Each Status-Code is described below, including a description of 1583 which method(s) it can follow and any metainformation required in 1584 the response. 1586 6.2.1 Successful 2xx 1588 This class of status codes indicates that the client's request was 1589 successfully received, understood, and accepted. 1591 200 OK 1593 o Following: any method 1594 o Required headers: none 1596 The request has been fulfilled and an entity corresponding to the 1597 requested resource is being sent in the response. If the HEAD 1598 method was used, the response should only contain the Entity-Header 1599 information and no Entity-Body. 1601 201 Created 1603 o Following: any method that may request a new resource 1604 be created 1605 o Required headers: URI-header 1607 The request has been fulfilled and resulted in a new resource being 1608 created. The newly created resource can be referenced by the URI(s) 1609 returned in the URI-header field of the response. The origin server 1610 is encouraged, but not obliged, to actually create the resource 1611 before using this Status-Code. If the action cannot be carried out 1612 immediately, or within a clearly defined timeframe, the server 1613 should respond with "202 Accepted" instead. 1615 Of the methods defined by this specification, only PUT and POST can 1616 create a resource. 1618 202 Accepted 1620 o Following: any method 1621 o Required headers: none 1623 The request has been accepted for processing, but the processing 1624 has not been completed. The request may or may not eventually be 1625 acted upon, as it may be disallowed when processing actually takes 1626 place. There is no facility for re-sending a status code from an 1627 asynchronous operation such as this. 1629 The "202 Accepted" response is intentionally non-committal. Its 1630 purpose is to allow a server to accept a request for some other 1631 process (perhaps a batch-oriented process that is only run once per 1632 day) without requiring that the user agent's connection to the 1633 server persist until the process is completed. The entity returned 1634 with this response should include an indication of the request's 1635 current status and either a pointer to a status monitor or some 1636 estimate of when the user can expect the request to be enacted. 1638 203 Provisional Information 1640 o Following: GET, HEAD 1641 o Required headers: none 1643 The returned metainformation in the Entity-Header is not the 1644 definitive set as available from the origin server, but is gathered 1645 from a local or a third-party copy. The set presented may be a 1646 subset or superset of the original version. For example, including 1647 local annotation information about the resource may result in a 1648 superset of the metainformation known by the origin server. 1650 204 No Content 1652 o Following: any method 1653 o Required headers: none 1655 The server has fulfilled the request but there is no new 1656 information to send back. If the client is a user agent, it should 1657 not change its document view. This response is primarily intended 1658 to allow input for scripts or other actions to take place without 1659 causing a change to the user agent's current document view. 1661 6.2.2 Redirection 3xx 1663 This class of status code indicates that further action needs to be 1664 taken by the client in order to fulfill the request. The action 1665 required can sometimes be carried out by the client without 1666 interaction with the user, but it is strongly recommended that this 1667 only takes place if the method used in the request is idempotent 1668 (GET or HEAD). 1670 300 Multiple Choices 1672 o Following: any method 1673 o Required headers: none 1675 The requested resource is available at one or more locations and a 1676 preferred location could not be determined via content negotiation. 1677 Unless it was a HEAD request, the response must include an entity 1678 containing a formatted list of resource characteristics and 1679 locations from which the user agent can choose the one most 1680 appropriate. The entity format is specified by the media type given 1681 in the Content-Type header field. Depending upon the format and the 1682 capabilities of the user agent, selection of the most appropriate 1683 choice may be performed automatically. 1685 301 Moved Permanently 1687 o Following: any method 1688 o Required headers: URI-header, Location 1690 The requested resource has been assigned a new permanent URI and 1691 any future references to this resource must be done using the 1692 returned URI. Clients with link editing capabilities are encouraged 1693 to automatically relink references to the Request-URI to the new 1694 reference returned by the server, where possible. 1696 It is possible for the server to send this status code in response 1697 to a request using the PUT, POST, or DELETE methods. However, as 1698 this might change the conditions under which the request was 1699 issued, the user agent must not automatically redirect the request 1700 unless it can be confirmed by the user. 1702 302 Moved Temporarily 1704 o Following: any method 1705 o Required headers: URI-header, Location 1707 The requested resource resides temporarily under a different URI. 1708 Since the redirection may be altered on occasion, the client should 1709 on future requests from the user continue to use the original 1710 Request-URI and not the URI returned in the URI-header field and 1711 Location fields. 1713 It is possible for the server to send this status code in response 1714 to a request using the PUT, POST, or DELETE methods. However, as 1715 this might change the conditions under which the request was 1716 issued, the user agent must not automatically redirect the request 1717 unless it can be confirmed by the user. 1719 303 Method 1721 This code is obsolete. 1723 304 Not Modified 1725 o Following: conditional GET 1726 o Required headers: none 1728 If the client has performed a conditional GET request and access is 1729 allowed, but the document has not been modified since the date and 1730 time specified in the If-Modified-Since field, the server shall 1731 respond with this status code and not send an Entity-Body to the 1732 client. Header fields contained in the response should only include 1733 information which is relevant to cache managers and which may have 1734 changed independently of the entity's Last-Modified date. Examples 1735 of relevant header fields include: Date, Server, and Expires. 1737 6.2.3 Client Error 4xx 1739 The 4xx class of status codes is intended for cases in which the 1740 client seems to have erred. If the client has not completed the 1741 request when a 4xx code is received, it should immediately cease 1742 sending data to the server. Except when responding to a HEAD 1743 request, the server is encouraged to include an entity containing 1744 an explanation of the error situation, and whether it is a 1745 temporary or permanent condition. These status codes are applicable 1746 to any request method. 1748 400 Bad Request 1750 The request had bad syntax or was inherently impossible to be 1751 satisfied. The client is discouraged from repeating the request 1752 without modifications. 1754 401 Unauthorized 1756 o Required headers: WWW-Authenticate 1758 The request requires user authentication. The response must include 1759 a WWW-Authenticate header field (Section 6.3.4) containing a 1760 challenge applicable to the requested resource. The client may 1761 repeat the request with a suitable Authorization header field. 1762 HTTP access authentication is explained in Section 10. 1764 402 Payment Required 1766 This code is not currently supported, but is reserved for future 1767 use. 1769 403 Forbidden 1771 The request is forbidden because of some reason that remains 1772 unknown to the client. Authorization will not help and the request 1773 should not be repeated. This status code can be used if the server 1774 does not want to make public why the request cannot be fulfilled. 1776 404 Not Found 1778 The server has not found anything matching the Request-URI. No 1779 indication is given of whether the condition is temporary or 1780 permanent. If the server does not wish to make this information 1781 available to the client, the status code "403 Forbidden" can be 1782 used instead. The "410 Gone" status code should be used if the 1783 server knows (through some internally configurable method) that an 1784 old resource is permanently unavailable and has no forwarding 1785 address. 1787 405 Method Not Allowed 1789 o Required headers: Allow 1791 The method specified in the Request-Line is not allowed for the 1792 resource identified by the Request-URI. The response must include 1793 an Allow header containing a list of valid method's for the 1794 requested resource. 1796 406 None Acceptable 1798 o Required headers: Content-*, where applicable to the Request-URI 1800 The server has found a resource matching the Request-URI, but not 1801 one that satisfies the conditions identified by the Accept and 1802 Accept-Encoding request headers. The response must include (when 1803 applicable) the Content-Type, Content-Encoding, and Content- 1804 Language of the resource, and is encouraged to include the 1805 resource's complete metainformation. No Entity-Body can be included 1806 in the response. 1808 407 Proxy Authentication Required 1810 This code is reserved for future use. It is similar to 1811 "401 Unauthorized", but indicates that the client must first 1812 authenticate itself with the proxy. HTTP/1.0 does not provide a 1813 means for proxy authentication -- this feature will be available in 1814 future versions. 1816 408 Request Timeout 1818 The client did not produce a request within the time that the 1819 server was prepared to wait. The client may repeat the request 1820 without modifications at any later time. 1822 409 Conflict 1824 The request could not be completed due to a conflict with the 1825 current state of the resource. This code is only allowed in 1826 situations where it is expected that the user may be able to 1827 resolve the conflict and resubmit the request. The response body 1828 should include enough information for the user to recognize the 1829 source of the conflict. Ideally, the response entity would include 1830 enough information for the user (or user-agent) to fix the problem; 1831 however, that may not be possible and is not required. 1833 Conflicts are most likely to occur in response to a PUT request. If 1834 versioning is being used and the entity being PUT includes changes 1835 to a resource which conflict with those made by an earlier (third- 1836 party) request, the server may use the "409 Conflict" response to 1837 indicate that it can't complete the PUT. In this case, the response 1838 entity may contain a list of the differences between the two 1839 versions. 1841 410 Gone 1843 The requested resource is no longer available at the server and no 1844 forwarding address is known. This condition should be considered 1845 permanent. Clients with link editing capabilities are encouraged to 1846 delete references to the Request-URI (after user approval). If the 1847 server does not know (or has no facility to determine) whether or 1848 not the condition is permanent, the status code "404 Not Found" can 1849 be used instead. 1851 The "410 Gone" response is primarily intended to assist the task of 1852 web maintenance by notifying the recipient that the resource is 1853 intentionally unavailable and that the server owners desire that 1854 remote links to that resource be removed. Such an event is common 1855 for limited-time, promotional services and for resources belonging 1856 to individuals no longer working at the server's site. It is not 1857 necessary to mark all permanently unavailable resources as "gone" 1858 or to keep the mark for any length of time -- that is left to the 1859 discretion of the server owner. 1861 6.2.4 Server Errors 5xx 1863 Response status codes beginning with the digit "5" indicate cases 1864 in which the server is aware that it has erred or is incapable of 1865 performing the request. If the client has not completed the request 1866 when a 5xx code is received, it should immediately cease sending 1867 data to the server. Except when responding to a HEAD request, the 1868 server is encouraged to include an entity containing an explanation 1869 of the error situation, and whether it is a temporary or permanent 1870 condition. These response codes are applicable to any request 1871 method and there are no required header fields. 1873 500 Internal Server Error 1875 The server encountered an unexpected condition which prevented it 1876 from fulfilling the request. 1878 501 Not Implemented 1880 The server does not support the functionality required to fulfill 1881 the request. This is the appropriate response when the server does 1882 not recognize the request method and is not capable of supporting 1883 it for any resource. 1885 502 Bad Gateway 1887 The server received an invalid response from the gateway or 1888 upstream server it accessed in attempting to complete the request. 1890 503 Service Unavailable 1892 The server is currently unable to handle the request due to a 1893 temporary overloading or maintenance of the server. The implication 1894 is that this is a temporary condition which will be alleviated 1895 after some delay. If known, the length of the delay may be 1896 indicated in a Retry-After header. If no Retry-After is given, the 1897 client should handle the response as it would a "500 Internal 1898 Server Error". 1900 Note: The presence of the 503 status code does not imply 1901 that a server must use it when becoming overloaded. Some 1902 servers may wish to simply refuse the connection. 1904 504 Gateway Timeout 1906 The server did not receive a timely response from the gateway or 1907 upstream server it accessed in attempting to complete the request. 1909 6.3 Response Header Fields 1911 The response header fields allow the server to pass additional 1912 information about the response which cannot be placed in the Status- 1913 Line. These header fields are not intended to give information 1914 about an Entity-Body returned in the response, but about the server 1915 itself. 1917 Response-Header= Public 1918 | Retry-After 1919 | Server 1920 | WWW-Authenticate 1921 | extension-header 1923 Although additional response header fields may be implemented via 1924 the extension mechanism, applications which do not recognize those 1925 fields should treat them as Entity-Header fields. 1927 6.3.1 Public 1929 The Public header field lists the set of non-standard methods 1930 supported by the server. The purpose of this field is strictly to 1931 inform the recipient of the capabilities of the server regarding 1932 unusual methods. The methods listed may or may not be applicable to 1933 the Request-URI; the Allow header field (Section 7.1.1) should be 1934 used to indicate methods allowed for a particular URI. This does 1935 not prevent a client from trying other methods. The field value 1936 should not include the methods predefined for HTTP/1.0 in Section 1937 5.2. 1939 Public = "Public" ":" 1#method 1941 Example of use: 1943 Public: OPTIONS, MGET, MHEAD 1945 This header field applies only to the current connection. If the 1946 response passes through a proxy, the proxy must either remove the 1947 Public header field or replace it with one applicable to its own 1948 capabilities. 1950 6.3.2 Retry-After 1952 The Retry-After header field can be used with "503 Service 1953 Unavailable" to indicate how long the service is expected to be 1954 unavailable to the requesting client. The value of this field can 1955 be either an full HTTP-date or an integer number of seconds (in 1956 decimal) after the time of the response. 1958 Retry-After = "Retry-After" ":" ( HTTP-date | delta-seconds ) 1960 Two examples of its use are 1962 Retry-After: Wed, 14 Dec 1994 18:22:54 GMT 1964 Retry-After: 120 1966 In the latter example, the delay is 2 minutes. 1968 6.3.3 Server 1970 The Server header field contains information about the software 1971 being used by the origin server program handling the request. The 1972 field is analogous to the User-Agent field and has the following 1973 format: 1975 Server = "Server" ":" 1*( product ) 1977 Example: 1979 Server: CERN/3.0 libwww/2.17 1981 If the response is being forwarded through a proxy, the proxy 1982 application must not add its data to the product list. Instead, it 1983 should include a Forwarded field, as described in Section 4.3.2. 1985 6.3.4 WWW-Authenticate 1987 The WWW-Authenticate header field must be included as part of a 1988 "401 Unauthorized" response. The field value consists of a 1989 challenge that indicates the authentication scheme and parameters 1990 applicable to the Request-URI. 1992 WWW-Authenticate = "WWW-Authenticate" ":" challenge 1994 The HTTP access authentication process is described in Section 10. 1996 7. Entity 1998 Full-Request and Full-Response messages may transfer an entity 1999 within some requests and responses. An entity consists of Entity- 2000 Header fields and (usually) an Entity-Body. In this section, both 2001 sender and recipient refer to either the client or the server, 2002 depending on who sends and who receives the entity. 2004 7.1 Entity Header Fields 2006 This section specifies the format and semantics of the Entity- 2007 Header fields. Entity-Header fields define optional metainformation 2008 about the Entity-Body or, if no body is present, about the resource 2009 identified by the request. 2011 Entity-Header = Allow 2012 | Content-Encoding 2013 | Content-Language 2014 | Content-Length 2015 | Content-Transfer-Encoding 2016 | Content-Type 2017 | Derived-From 2018 | Expires 2019 | Last-Modified 2020 | Link 2021 | Location 2022 | Title 2023 | URI-header 2024 | Version 2025 | extension-header 2027 extension-header = HTTP-header 2029 Each entity header field is explained in the subsections below. 2030 Other header fields are allowed but cannot be assumed to be 2031 recognizable by the recipient. Unknown header fields should be 2032 ignored by the recipient and forwarded by proxies. 2034 Note: It has been proposed that any HTML metainformation 2035 element (allowed within the element of a document) be 2036 a valid candidate for an HTTP entity header. This document 2037 defines two header fields, Link and Title, which are both 2038 examples of this. Base will be used in future versions of 2039 HTTP. 2041 7.1.1 Allow 2043 The Allow header field lists the set of methods supported by the 2044 resource identified by the Request-URI. The purpose of this field 2045 is strictly to inform the recipient of valid methods associated 2046 with the resource; it must be present in a response with status 2047 code "405 Method Not Allowed". 2049 Allow = "Allow" ":" 1#method 2051 Example of use: 2053 Allow: GET, HEAD, PUT 2055 This does not prevent a client from trying other methods. However, 2056 it is recommended that the indications given by this field be 2057 followed. This field has no default value; if left undefined, the 2058 set of allowed methods is defined by the origin server at the time 2059 of each request. 2061 If a response passes through a proxy which does not understand one 2062 or more of the methods indicated in the Allow header, the proxy 2063 must not modify the Allow header; the user agent may have other 2064 means of communicating with the origin server. 2066 7.1.2 Content-Encoding 2068 The Content-Encoding header field is used as a modifier to the 2069 media-type. When present, its value indicates what additional 2070 encoding mechanism has been applied to the resource, and thus what 2071 decoding mechanism must be applied in order to obtain the media- 2072 type referenced by the Content-Type header field. The Content- 2073 Encoding is primarily used to allow a document to be compressed 2074 without losing the identity of its underlying media type. 2076 Content-Encoding = "Content-Encoding" ":" encoding-mechanism 2078 Encoding mechanisms are defined in Section 8.4. An example of its 2079 use is 2081 Content-Encoding: gzip 2083 The Content-Encoding is a characteristic of the resource identified 2084 by the Request-URI. Typically, the resource is stored with this 2085 encoding and is only decoded before rendering or analogous usage. 2087 7.1.3 Content-Language 2089 The Content-Language field describes the natural language(s) of the 2090 intended audience for the enclosed entity. Note that this may not 2091 be equivalent to all the languages used within the entity. 2093 Content-Language = "Content-Language" ":" 1#language-tag 2095 Language tags are defined in Section 8.2. The primary purpose of 2096 Content-Language is to allow a selective consumer to identify and 2097 differentiate resources according to the consumer's own preferred 2098 language. Thus, if the body content is intended only for a Danish 2099 audience, the appropriate field is 2101 Content-Language: dk 2103 If no Content-Language is specified, the default is that the 2104 content is intended for all language audiences. This may mean that 2105 the sender does not consider it to be specific to any natural 2106 language, or that the sender does not know for which language it is 2107 intended. 2109 Multiple languages may be listed for content that is intended for 2110 multiple audiences. For example, a rendition of the "Treaty of 2111 Waitangi," presented simultaneously in the original Maori and 2112 English versions, would call for 2114 Content-Language: mi, en 2116 However, just because multiple languages are present within an 2117 entity does not mean that it is intended for multiple linguistic 2118 audiences. An example would be a beginner's language primer, such 2119 as "A First Lesson in Latin," which is clearly intended to be used 2120 by an English audience. In this case, the Content-Language should 2121 only include "en". 2123 Content-Language may be applied to any media type -- it should not 2124 be considered limited to textual documents. 2126 7.1.4 Content-Length 2128 The Content-Length header field indicates the size of the Entity- 2129 Body (in decimal number of octets) sent to the recipient or, in the 2130 case of the HEAD method, the size of the Entity-Body that would 2131 have been sent had the request been a GET. 2133 Content-Length = "Content-Length" ":" 1*DIGIT 2135 An example is 2137 Content-Length: 3495 2139 Although it is not required, applications are strongly encouraged 2140 to use this field to indicate the size of the Entity-Body to be 2141 transferred, regardless of the media type of the entity. 2143 Any Content-Length greater than or equal to zero is a valid value. 2144 Section 7.2.2 describes how to determine the length of an Entity- 2145 Body if a Content-Length is not given. 2147 Note: The meaning of this field is significantly different 2148 from the corresponding definition in MIME, where it is an 2149 optional field used within the "message/external-body" 2150 content-type. In HTTP, it should be used whenever the 2151 entity's length can be determined prior to being transferred. 2153 7.1.5 Content-Transfer-Encoding 2155 The Content-Transfer-Encoding (CTE) header indicates what (if any) 2156 type of transformation has been applied to the entity in order to 2157 safely transfer it between the sender and the recipient. This 2158 differs from the Content-Encoding in that the CTE is a property of 2159 the message, not of the original resource. 2161 Content-Transfer-Encoding 2162 = "Content-Transfer-Encoding" ":" transfer-encoding 2164 Transfer encodings are defined in Section 8.5. Because all HTTP 2165 transactions take place on an 8-bit clean connection, the default 2166 Content-Transfer-Encoding for all messages is binary. However, HTTP 2167 may be used to transfer MIME messages which already have a defined 2168 CTE. An example is: 2170 Content-Transfer-Encoding: quoted-printable 2172 Many older HTTP/1.0 applications do not understand the Content- 2173 Transfer-Encoding header. However, since it may appear in any MIME 2174 message (i.e. entities retrieved via a gateway to a MIME-conformant 2175 protocol), future HTTP/1.0 applications are required to understand 2176 it upon receipt. Gateways are the only HTTP applications that would 2177 generate a CTE. 2179 7.1.6 Content-Type 2181 The Content-Type header field indicates the media type of the 2182 Entity-Body sent to the recipient or, in the case of the HEAD 2183 method, the media type that would have been sent had the request 2184 been a GET. 2186 Content-Type = "Content-Type" ":" media-type 2188 Media types are defined in Section 8.1. An example of the field is 2190 Content-Type: text/html; charset=ISO-8859-4 2192 The Content-Type header field has no default value. Further 2193 discussion of methods for identifying the media type of an entity 2194 is provided in Section 7.2.1. 2196 7.1.7 Derived-From 2198 The Derived-From header field can be used to indicate the version 2199 tag of the resource from which the enclosed entity was derived 2200 before modifications were made by the sender. This field is used to 2201 help manage the process of merging successive changes to a 2202 resource, particularly when such changes are being made in parallel 2203 and from multiple sources. 2205 Derived-From = "Derived-From" ":" version-tag 2207 An example use of the field is: 2209 Derived-From: 2.1.1 2211 A longer example of version control is included in Appendix C. The 2212 Derived-From field is required for PUT requests if the entity being 2213 put was previously retrieved from the same URI and a Version header 2214 was included with the entity when it was last retrieved. 2216 7.1.8 Expires 2218 The Expires field gives the date/time after which the entity should 2219 be considered stale. This allows information providers to suggest 2220 the volatility of the resource. Caching clients (including proxies) 2221 must not cache this copy of the resource beyond the date given, 2222 unless its status has been updated by a later check of the origin 2223 server. The presence of an Expires field does not imply that the 2224 original resource will change or cease to exist at, before, or 2225 after that time. However, information providers that know (or even 2226 suspect) that a resource will change by a certain date are strongly 2227 encouraged to include an Expires header with that date. The format 2228 is an absolute date and time as defined by HTTP-date in Section 3.3. 2230 Expires = "Expires" ":" HTTP-date 2232 An example of its use is 2234 Expires: Thu, 01 Dec 1994 16:00:00 GMT 2236 The Expires field has no default value. If the date given is equal 2237 to or earlier than the value of the Date header, the recipient must 2238 not cache the enclosed entity. If a resource is dynamic by nature, 2239 as is the case with many data-producing processes, copies of that 2240 resource should be given an appropriate Expires value which 2241 reflects that dynamism. 2243 The Expires field cannot be used to force a user agent to refresh 2244 its display or reload a resource; its semantics apply only to 2245 caching mechanisms, and such mechanisms need only check a 2246 resource's expiration status when a new request for that resource 2247 is initiated. 2249 Note: Applications are encouraged to be tolerant of bad or 2250 misinformed implementations of the Expires header. In 2251 particular, recipients may wish to recognize a delta-seconds 2252 value (any decimal integer) as representing the number of 2253 seconds after receipt of the message that its contents 2254 should be considered expired. Likewise, a value of zero (0) 2255 or an invalid date format may be considered equivalent to an 2256 "expires immediately." Although these values are not 2257 legitimate for HTTP/1.0, a robust implementation is always 2258 desirable. 2260 7.1.9 Last-Modified 2262 The Last-Modified header field indicates the date and time at which 2263 the sender believes the resource was last modified. The exact 2264 semantics of this field are defined in terms of how the receiver 2265 should interpret it: if the receiver has a copy of this resource 2266 which is older than the date given by the Last-Modified field, that 2267 copy should be considered stale. 2269 Last-Modified = "Last-Modified" ":" HTTP-date 2271 An example of its use is 2273 Last-Modified: Tue, 15 Nov 1994 12:45:26 GMT 2275 The exact meaning of this header field depends on the 2276 implementation of the sender and the nature of the original 2277 resource. For files, it may be just the file system last-mod date. 2278 For entities with dynamically included parts, it may be the most 2279 recent of the set of last-mod dates of its component parts. For 2280 database gateways, it may be the last-update timestamp of the 2281 record. For virtual objects, it may be the last time the internal 2282 state changed. In any case, the recipient should only know (and 2283 care) about the result -- whatever gets stuck in the Last-Modified 2284 field -- and not worry about how that result was obtained. 2286 7.1.10 Link 2288 The Link header provides a means for describing a relationship 2289 between the entity and some other resource. An entity may include 2290 multiple Link values. Links at the metainformation level typically 2291 indicate relationships like hierarchical structure and navigation 2292 paths. The Link field is semantically equivalent to the 2293 element in HTML [4]. 2295 Link = "Link" ":" 1#("<" URI ">" 2296 [ ";" "rel" "=" relation ] 2297 [ ";" "rev" "=" relation ] 2298 [ ";" "title" "=" quoted-string ] ) 2300 relation = sgml-name 2302 sgml-name = ALPHA *( ALPHA | DIGIT | "." | "-" ) 2304 Relation values are not case-sensitive and may be extended within 2305 the constraints of the sgmlname syntax. There are no predefined 2306 link relationship values for HTTP/1.0. The title parameter may be 2307 used to label the destination of a link such that it can be used as 2308 identification within a human-readable menu. Examples of usage 2309 include: 2311 Link: ; rel="Previous" 2313 Link: ; rev="Made"; title="Tim Berners-Lee" 2315 The first example indicates that the entity is previous to chapter2 2316 in a logical navigation path. The second indicates that the 2317 publisher of the resource is identified by the given e-mail address. 2319 7.1.11 Location 2321 The Location header field is an earlier form of the URI-header and 2322 is considered obsolete. However, HTTP/1.0 applications should 2323 continue to support the Location header in order to properly 2324 interface with older applications. The purpose of Location is 2325 identical to that of the URI-header, except that no variants can be 2326 specified and only one absolute location URL is allowed. 2328 Location = "Location" ":" URI 2330 An example is 2332 Location: http://info.cern.ch/hypertext/WWW/NewLocation.html 2334 7.1.12 Title 2336 The Title header field indicates the title of the entity 2338 Title = "Title" ":" *text 2340 An example of the field is 2342 Title: Hypertext Transfer Protocol -- HTTP/1.0 2344 This field is to be considered isomorphic with the element 2345 in HTML [4]. 2347 7.1.13 URI 2349 The URI-header field may contain one or more Universal Resource 2350 Identifiers (URIs) by which the resource origin of the entity can 2351 be identified. There is no guarantee that the resource can be 2352 accessed using the URI(s) specified. This field is required for the 2353 201, 301, and 302 response messages, and may be included in any 2354 message that contains resource metainformation. 2356 URI-header = "URI" ":" 1#( "<" URI ">" [ ";" vary ] ) 2358 vary = "vary" "=" <"> 1#vary-dimension <"> 2359 vary-dimension = "type" | "language" | "version" | "encoding" 2360 | "charset" | "user-agent" | extension-vary 2362 extension-vary = token 2364 Any URI specified in this field can be either absolute or relative 2365 to the URI given in the Request-Line. The URI-header improves upon 2366 the Location header field described in Section 7.1.11. For 2367 backwards compatibility with older clients, servers are encouraged 2368 to include both header fields in 301 and 302 responses. 2370 The URI-header may also be used by a client performing a POST 2371 request to suggest a URI for the new entity. Whether or not the 2372 suggested URI is used is entirely up to the server to decide. In 2373 any case, the server's response must include the actual URI(s) of 2374 the new resource if one is successfully created (status 201). 2376 If a URI refers to a set of variants, then the dimensions of that 2377 variance must be given with a vary parameter. One example is: 2379 URI: <http://info.cern.ch/hypertext/WWW/TheProject.multi>; 2380 vary="type,language" 2382 which indicates that the URI covers a group of entities that vary 2383 in media type and natural language. A request for that URI will 2384 result in a response that depends upon the client's request headers 2385 for Accept and Accept-Language. Similar dimensions exist for the 2386 Accept-Encoding, Accept-Charset, Version, and User-Agent header 2387 fields, as demonstrated in the following example. 2389 URI: <TheProject.ps>;vary="encoding,version", 2390 <TheProject.html>;vary="user-agent,charset,version" 2392 The vary parameter has an important effect on cache management, 2393 particularly for caching proxies which service a diverse set of 2394 user agents. Since the response to one user agent may differ from 2395 the response to a second user agent if the two agents have 2396 differing request profiles, a caching proxy must keep track of the 2397 content metainformation for resources with varying dimensions. 2398 Thus, the vary parameter tells the caching proxy what entity 2399 headers must be part of the key for caching that URI. When the 2400 caching proxy gets a request for that URI, it must forward the 2401 request toward the origin server if the request profile includes a 2402 variant dimension that has not already been cached. 2404 7.1.14 Version 2406 The Version field defines the version tag associated with a 2407 rendition of an evolving entity. Together with the Derived-From 2408 field described in Section 7.1.7, it allows a group of people to 2409 work simultaneously on the creation of a work as an iterative 2410 process. The field should be used to allow evolution of a 2411 particular work along a single path. It should not be used to 2412 indicate derived works or renditions in different representations. 2414 Version = "Version" ":" version-tag 2416 version-tag = token | quoted-string 2418 Examples of the Version field include: 2420 Version: 2.1.2 2421 Version: "Fred 19950116-12:26:48" 2422 Version: 2.5a4-omega7 2424 The version tag should be considered opaque to all parties but the 2425 origin server. A user agent can request a particular version of an 2426 entity by including its tag in a Version header as part of the 2427 request. Similarly, a user agent may suggest a value for the 2428 version of an entity transferred via a PUT or POST request. 2429 However, only the origin server can reliably assign or increment 2430 the version tag of an entity. 2432 7.2 Entity Body 2434 The entity-body (if any) sent with an HTTP/1.0 request or response 2435 is in a format and encoding defined by the Entity-Header fields. 2437 Entity-Body = *OCTET 2439 An entity-body is included with a request message only when the 2440 request method calls for one. This specification defines two 2441 request methods, "POST" and "PUT", that allow an entity-body. In 2442 general, the presence of an entity-body in a request is signaled by 2443 the inclusion of a Content-Length and/or Content-Transfer-Encoding 2444 header field in the request message headers. 2446 Note: Most current implementations of the POST and PUT 2447 methods require a valid Content-Length header field. This 2448 can cause problems for some systems that do not know the 2449 size of the entity-body before transmission. Experimental 2450 implementations (and future versions of HTTP) may use a 2451 packetized Content-Transfer-Encoding to obviate the need for 2452 a Content-Length. 2454 For response messages, whether or not an entity-body is included 2455 with a message is dependent on both the request method and the 2456 response code. All responses to the HEAD request method must not 2457 include a body, even though the presence of Content header fields 2458 may lead one to believe they should. Similarly, the responses "204 2459 No Content", "304 Not Modified", and "406 None Acceptable" must not 2460 include a body. 2462 7.2.1 Type 2464 When an Entity-Body is included with a message, the data type of 2465 that body is determined via the header fields Content-Type, 2466 Content-Encoding, and Content-Transfer-Encoding. These define a 2467 three-layer, ordered encoding model: 2469 entity-body <- 2470 Content-Transfer-Encoding( Content-Encoding( Content-Type ) ) 2472 The default for both encodings is none (i.e., the identity 2473 function). A Content-Type specifies the media type of the 2474 underlying data. A Content-Encoding may be used to indicate an 2475 additional encoding mechanism applied to the type (usually for the 2476 purpose of data compression) that is a property of the resource 2477 requested. A Content-Transfer-Encoding may be applied by a 2478 transport agent to ensure safe and/or proper transfer of the 2479 message. Note that the Content-Transfer-Encoding is a property of 2480 the message, not of the resource. 2482 The Content-Type header field has no default value. If and only if 2483 the media type is not given by a Content-Type header (as is always 2484 the case for Simple-Response messages), the receiver may attempt to 2485 guess the media type via inspection of its content and/or the name 2486 extension(s) of the URL used to access the resource. If the media 2487 type remains unknown, the receiver should treat it as type 2488 "application/octet-stream". 2490 7.2.2 Length 2492 When an Entity-Body is included with a message, the length of that 2493 body may be determined in one of several ways. If a Content-Length 2494 header field is present, its value in bytes (number of octets) 2495 represents the length of the Entity-Body. Otherwise, the body 2496 length is determined by the Content-Type (for types with an 2497 explicit end-of-body delimiter), the Content-Transfer-Encoding (for 2498 packetized encodings), or the closing of the connection by the 2499 server. Note that the latter cannot be used to indicate the end of 2500 a request body, since it leaves no possibility for the server to 2501 send back a response. 2503 Note: Some older servers supply an invalid Content-Length 2504 when sending a document that contains server-side includes 2505 dynamically inserted into the data stream. It must be 2506 emphasized that this will not be tolerated by future 2507 versions of HTTP. Unless the client knows that it is 2508 receiving a response from a compliant server, it should not 2509 depend on the Content-Length value being correct. 2511 8. Content Parameters 2513 8.1 Media Types 2515 HTTP uses Internet Media Types [15], formerly referred to as MIME 2516 Content-Types [6], in order to provide open and extensible data 2517 typing and type negotiation. For mail applications, where there is 2518 no type negotiation between sender and receiver, it is reasonable 2519 to put strict limits on the set of allowed media types. With HTTP, 2520 however, user agents can identify acceptable media types as part of 2521 the connection, and thus are allowed more freedom in the use of non- 2522 registered types. The following grammar for media types is a 2523 superset of that for MIME because it does not restrict itself to 2524 the official IANA and x-token types. 2526 media-type = type "/" subtype *( ";" parameter ) 2527 type = token 2528 subtype = token 2530 Parameters may follow the type/subtype in the form of 2531 attribute/value pairs. 2533 parameter = attribute "=" value 2534 attribute = token 2535 value = token | quoted-string 2537 The type, subtype, and parameter attribute names are not case- 2538 sensitive. Parameter values may or may not be case-sensitive, 2539 depending on the semantics of the parameter name. No LWS is allowed 2540 between the type and subtype, nor between an attribute and its 2541 value. 2543 If a given media-type value has been registered by the IANA, any 2544 use of that value must be indicative of the registered data format. 2545 Although HTTP allows the use of non-registered media types, such 2546 usage must not conflict with the IANA registry. Data providers are 2547 strongly encouraged to register their media types with IANA via the 2548 procedures outlined in RFC 1590 [15]. 2550 All media-type's registered by IANA must be preferred over 2551 extension tokens. However, HTTP does not limit conforming 2552 applications to the use of officially registered media types, nor 2553 does it encourage the use of an "x-" prefix for unofficial types 2554 outside of explicitly short experimental use between consenting 2555 applications. 2557 8.1.1 Canonicalization and Text Defaults 2559 Media types are registered in a canonical form. In general, entity 2560 bodies transferred via HTTP must be represented in the appropriate 2561 canonical form prior to transmission. If the body has been encoded 2562 via a Content-Encoding and/or Content-Transfer-Encoding, the data 2563 must be in canonical form prior to that encoding. However, HTTP 2564 modifies the canonical form requirements for media of primary type 2565 "text" and for "application" types consisting of text-like records. 2567 HTTP redefines the canonical form of text media to allow multiple 2568 octet sequences to indicate a text line break. In addition to the 2569 preferred form of CRLF, HTTP applications must accept a bare CR or 2570 LF alone as representing a single line break in text media. 2571 Furthermore, if the text media is represented in a character set 2572 which does not use octets 13 and 10 for CR and LF respectively (as 2573 is the case for some multi-byte character sets), HTTP allows the 2574 use of whatever octet sequence(s) is defined by that character set 2575 to represent the equivalent of CRLF, bare CR, and bare LF. It is 2576 assumed that any recipient capable of using such a character set 2577 will know the appropriate octet sequence for representing line 2578 breaks within that character set. 2580 Note: This interpretation of line breaks applies only to the 2581 contents of an Entity-Body and only after any Content- 2582 Transfer-Encoding and/or Content-Encoding has been removed. 2583 All other HTTP constructs use CRLF exclusively to indicate a 2584 line break. Encoding mechanisms define their own line break 2585 requirements. 2587 A recipient of an HTTP text entity should translate the received 2588 entity line breaks to the local line break conventions before 2589 saving the entity external to the application and its cache; 2590 whether this translation takes place immediately upon receipt of 2591 the entity, or only when prompted by the user, is entirely up to 2592 the individual application. 2594 HTTP also redefines the default character set for text media in an 2595 entity body. If a textual media type defines a charset parameter 2596 with a registered default value of "US-ASCII", HTTP changes the 2597 default to be "ISO-8859-1". Since the character set ISO-8859-1 [19] 2598 is a superset of USASCII [18], this has no effect upon the 2599 interpretation of entity bodies which only contain octets within 2600 the US-ASCII set (0 - 127). The presence of a charset parameter 2601 value in a Content-Type header field overrides the default. 2603 HTTP does not require that the character set of an entity body be 2604 labelled as the lowest common denominator of the character codes 2605 used within a document. 2607 8.1.2 Multipart Types 2609 MIME provides for a number of "multipart" types -- encapsulations of 2610 several entities within a single message's Entity-Body. The 2611 multipart types registered by IANA [17] do not have any special 2612 meaning for HTTP/1.0, though user agents may need to understand 2613 each type in order to correctly interpret the purpose of each body- 2614 part. Ideally, an HTTP user agent should follow the same or similar 2615 behavior as a MIME user agent does upon receipt of a multipart type. 2617 As in MIME [6], all multipart types share a common syntax and must 2618 include a boundary parameter as part of the media type value. The 2619 message body is itself a protocol element and must therefore use 2620 only CRLF to represent line breaks between body-parts. Unlike in 2621 MIME, multipart body-parts may contain HTTP header fields which are 2622 significant to the meaning of that part. 2624 A URI-header field (Section 7.1.13) should be included in the body- 2625 part for each enclosed entity that can be identified by a URI. 2627 8.2 Language Tags 2629 A language tag identifies a natural language spoken, written, or 2630 otherwise conveyed by human beings for communication of information 2631 to other human beings. Computer languages are explicitly excluded. 2632 The HTTP/1.0 protocol uses language tags within the Accept-Language 2633 and Content-Language header fields. 2635 The syntax and registry of HTTP language tags is the same as that 2636 defined by RFC 1766 [1]. In summary, a language tag is composed of 2637 1 or more parts: A primary language tag and a (possibly empty) 2638 series of subtags: 2640 language-tag = primary-tag *( "-" subtag ) 2642 primary-tag = 1*8ALPHA 2643 subtag = 1*8ALPHA 2645 Whitespace is not allowed within the tag and all tags are to be 2646 treated as case insensitive. The namespace of language tags is 2647 administered by the IANA. Example tags include: 2649 en, en-US, en-cockney, i-cherokee, x-pig-latin 2651 where any two-letter primary-tag is an ISO 639 language 2652 abbreviation and any two-letter initial subtag is an ISO 3166 2653 country code. 2655 Note: Earlier versions of this document specified an 2656 incomplete language tag, where values were limited to ISO 2657 639 language abbreviations with an optional ISO 3166 country 2658 code appended after an underscore ("_") or slash ("/") 2659 character. This format was abandoned in favor of the 2660 recently proposed standard for Internet protocols. 2662 8.3 Character Sets 2664 HTTP uses the same definition of the term "character set" as that 2665 described for MIME: 2667 The term "character set" is used in this document to 2668 refer to a method used with one or more tables to convert 2669 a sequence of octets into a sequence of characters. Note 2670 that unconditional conversion in the other direction is 2671 not required, in that not all characters may be available 2672 in a given character set and a character set may provide 2673 more than one sequence of octets to represent a 2674 particular character. This definition is intended to 2675 allow various kinds of character encodings, from simple 2676 single-table mappings such as US-ASCII to complex table 2677 switching methods such as those that use ISO 2022's 2678 techniques. However, the definition associated with a 2679 MIME character set name must fully specify the mapping to 2680 be performed from octets to characters. In particular, 2681 use of external profiling information to determine the 2682 exact mapping is not permitted. 2684 Character sets are identified by case-insensitive tokens. The 2685 complete set of allowed charset values are defined by the IANA 2686 Character Set registry [17]. However, because that registry does 2687 not define a single, consistent token for each character set, we 2688 define here the preferred names for those character sets most 2689 likely to be used with HTTP entities. This set of charset values 2690 includes those registered by RFC 1521 [6] -- the US-ASCII [18] and 2691 ISO8859 [19] character sets -- and other character set names 2692 specifically recommended for use within MIME charset parameters. 2694 charset = "US-ASCII" 2695 | "ISO-8859-1" | "ISO-8859-2" | "ISO-8859-3" 2696 | "ISO-8859-4" | "ISO-8859-5" | "ISO-8859-6" 2697 | "ISO-8859-7" | "ISO-8859-8" | "ISO-8859-9" 2698 | "ISO-2022-JP" | "ISO-2022-JP-2" | "ISO-2022-KR" 2699 | "UNICODE-1-1" | "UNICODE-1-1-UTF-7" | "UNICODE-1-1-UTF-8" 2700 | token 2702 Although HTTP allows an arbitrary token to be used as a character 2703 set value, any token that has a predefined value within the IANA 2704 Character Set registry [17] must represent the character set 2705 defined by that registry. Applications are encouraged, but not 2706 required, to limit their use of character sets to those defined by 2707 the IANA registry. 2709 8.4 Encoding Mechanisms 2711 Encoding mechanism values are used to indicate an encoding 2712 transformation that has been or can be applied to a resource. 2713 Encoding mechanisms are primarily used to allow a document to be 2714 compressed or encrypted without losing the identity of its 2715 underlying media type. Typically, the resource is stored with this 2716 encoding and is only decoded before rendering or analogous usage. 2718 encoding-mechanism = "gzip" | "compress" | token 2720 Note: For historical reasons, HTTP/1.0 applications should 2721 consider "x-gzip" and "x-compress" to be equivalent to 2722 "gzip" and "compress", respectively. 2724 All encoding-mechanism values are case-insensitive. HTTP/1.0 uses 2725 encoding-mechanism values in the Accept-Encoding (Section 5.4.3) 2726 and Content-Encoding (Section 7.1.2) header fields. Although the 2727 value describes the encoding-mechanism, what is more important is 2728 that it indicates what decoding mechanism will be required to 2729 remove the encoding. Note that a single program may be capable of 2730 decoding multiple encoding-mechanism formats. Two values are 2731 defined by this specification: 2733 gzip An encoding format produced by the file compression program 2734 "gzip" (GNU zip) developed by Jean-loup Gailly. This format 2735 is typically a Lempel-Ziv coding (LZ77) with a 32 bit CRC. 2736 Gzip is available from the GNU project at 2737 <URL:ftp://prep.ai.mit.edu/pub/gnu/>. 2739 compress The encoding format produced by the file compression 2740 program "compress". This format is an adaptive Lempel-Ziv- 2741 Welch coding (LZW). 2743 8.5 Transfer Encodings 2745 Transfer encoding values are used to indicate an encoding 2746 transformation that has been, can be, or may need to be applied to 2747 an Entity-Body in order to ensure safe transport through the 2748 network. Transfer encodings are only used with entities destined 2749 for or retrieved from MIME-conformant systems, and thus will rarely 2750 occur in an HTTP/1.0 message. This differs from an encoding- 2751 mechanism in that the transfer encoding is a property of the 2752 message, not of the original resource. 2754 transfer-encoding = "binary" | "8bit" | "7bit" 2755 | "quoted-printable" | "base64" 2756 | token 2758 All transfer-encoding values are case-insensitive. HTTP/1.0 uses 2759 transfer-encoding values in the Accept-Encoding (Section 5.4.3) and 2760 Content-Transfer-Encoding (Section 7.1.5) header fields. 2762 The values "7bit", "8bit", and "binary" are used to indicate that 2763 no transfer encoding has been performed. Instead, they describe the 2764 sort of encoding that might be needed for transmission through an 2765 unsafe transport system. Binary indicates that the body may contain 2766 any set of octets. 8bit adds the restrictions that CR and LF 2767 characters only occur as part of CRLF line separators, all lines 2768 are short (less than 1000 octets), and no NULs (octet 0) are 2769 present. 7bit adds a further restriction that all octets are 7-bit 2770 US-ASCII characters. 2772 The "quoted-printable" and "base64" values indicate that the 2773 associated encoding (as defined in MIME [6]) has been applied to 2774 the body. These encodings consist entirely of 7-bit US-ASCII 2775 characters. 2777 9. Content Negotiation 2779 Content negotiation is an optional feature of the HTTP protocol. It 2780 is designed to allow for preemptive selection of a preferred 2781 content representation, within a single request-response round-trip, 2782 and without intervention from the user. However, this may not 2783 always be desirable for the user and is sometimes unnecessary for 2784 the content provider. Implementors are encouraged to provide 2785 mechanisms whereby the amount of preemptive content negotiation, 2786 and the parameters of that negotiation, are configurable by the 2787 user and server maintainer. 2789 The first step in the negotiation algorithm is for the server to 2790 determine whether or not there are any content variants for the 2791 requested resource. Content variants may be in the form of multiple 2792 preexisting entities or a set of dynamic conversion filters. If 2793 there are no variant forms of the resource, the "negotiation" is 2794 limited to whether or not that single media type is acceptable 2795 under the constraints given by the Accept request header field 2796 (if any). 2798 If variants are available, those variants that are completely 2799 unacceptable should be removed from consideration first. 2800 Unacceptable variants include those with a Content-Encoding not 2801 listed in an Accept-Encoding field, those with a character subset 2802 (other than the default ISO-8859-1) not listed in an Accept-Charset 2803 field, and those with a media type not within any of the media 2804 ranges of an explicitly constrained Accept field (or listed with a 2805 zero quality parameter). 2807 If no acceptable variants remain at this point, the server should 2808 respond with a "406 None Acceptable" response message. If more than 2809 one variant remains, and at least one has a Content-Language within 2810 those listed by an Accept-Language field, any variants which do not 2811 match the language constraint are removed from further 2812 consideration. 2814 If multiple choices still remain, the selection is further winnowed 2815 by calculating and comparing the relative quality of the available 2816 media types. The calculated weights are normalized to a real number 2817 in the range 0 through 1, where 0 is the minimum and 1 the maximum 2818 value. The following parameters are included in the calculation: 2820 q The quality factor chosen by the user agent (and 2821 configurable by the user) that represents the desirability 2822 of that media type. In this case, desirability is usually a 2823 measure of the clients ability to faithfully represent the 2824 contents of that media type to the user. The value is in 2825 the range [0,1], where the default value is 1. 2827 qs The quality factor, as chosen by the server (via some 2828 unspecified mechanism), to represent the relative quality 2829 of a particular variant representation of the source. For 2830 example, a picture originally in JPEG form would have a 2831 lower qs when translated to the XBM format, and much lower 2832 qs when translated to an ASCII-art representation. Note, 2833 however, that this is a function of the source -- an 2834 original piece of ASCII-art may degrade in quality if it is 2835 captured in JPEG form. The qs value has the same range and 2836 default as q. 2838 mxb The maximum number of bytes in the Entity-Body accepted by 2839 the client. The default value is mxb=undefined 2840 (i.e. infinity). 2842 bs The actual number of bytes in the Entity-Body for a 2843 particular source representation. This should equal the 2844 value sent as Content-Length. The default value is 0. 2846 The discrete mapping function is defined as: 2848 { if mxb=undefined, then (qs * q) } 2849 Q(q,qs,mxb,bs) = { if mxb >= bs, then (qs * q) } 2850 { if mxb < bs, then 0 } 2852 The variants with a maximal value for the Q function represent the 2853 preferred representation(s) of the entity. If multiple 2854 representations exist for a single media type (as would be the case 2855 if they only varied by Content-Encoding), then the smallest 2856 representation (lowest bs) is preferred. 2858 Finally, there may still be multiple choices available to the user. 2859 If so, the server may either choose one (possibly at random) from 2860 those available and respond with "200 OK", or it may respond with 2861 "300 Multiple Choices" and include an entity describing the 2862 choices. In the latter case, the entity should either be of type 2863 "text/html' (such that the user can choose from among the choices 2864 by following an exact link) or of some type that would allow the 2865 user agent to perform the selection automatically (no such type is 2866 available at the time of this writing). 2868 The "300 Multiple Choices" response can be given even if the server 2869 does not perform any winnowing of the representation choices via 2870 the content negotiation algorithm described above. Furthermore, it 2871 may include choices that were not considered as part of the 2872 negotiation algorithm and resources that may be located at other 2873 servers. 2875 10. Access Authentication 2877 HTTP provides a simple challenge-response authorization mechanism 2878 which may be used by a server to challenge a client request and by 2879 a client to provide authentication information. The mechanism uses 2880 an extensible token to identify the authentication scheme, followed 2881 by a comma-separated list of attribute-value pairs which carry the 2882 parameters necessary for achieving authentication via that scheme. 2884 auth-scheme = "Basic" | token 2886 auth-param = token "=" quoted-string 2888 The "401 Unauthorized" response message is used by an origin server 2889 to challenge the authorization of a user agent. This response must 2890 include a WWW-Authenticate header field containing the challenge 2891 applicable to the requested resource. 2893 challenge = auth-scheme 1*LWS realm [ "," 1#auth-param ] 2895 realm = "Realm" "=" quoted-string 2897 The realm attribute is required for all access authentication 2898 schemes which issue a challenge. The realm value, in combination 2899 with the root URL of the server being accessed, defines the 2900 authorization space. These realms allow the protected resources on 2901 a server to be partitioned into a set of authorization spaces, each 2902 with its own authentication scheme and/or database. The realm value 2903 is a string, generally assigned by the origin server, which may 2904 have additional semantics specific to the authentication scheme. 2906 A user agent that wishes to authenticate itself with a server 2907 (usually, but not necessarily, after receiving a 401 response), may 2908 do so by including an Authorization header field with the request. 2909 The Authorization field value consists of credentials containing 2910 the authentication information of the user agent for the realm of 2911 the resource being requested. 2913 credentials = auth-scheme [ 1*LWS encoded-cookie ] #auth-param 2915 encoded-cookie = 1*<any CHAR except CTLs or tspecials, 2916 but including "=" and "/"> 2918 The domain over which credentials can be automatically applied by a 2919 user agent is determined by the authorization space. If a request 2920 is authenticated, the credentials can be reused for all other 2921 requests within that authorization space for a period of time 2922 determined by the authentication scheme, parameters, and/or user 2923 preference. 2925 The HTTP protocol does not restrict applications to this simple 2926 challenge-response mechanism for access authentication. Additional 2927 mechanisms may be used at the transport level, via message 2928 encapsulation, and/or with additional header fields specifying 2929 authentication information. However, these additional mechanisms 2930 are not defined by this specification. 2932 Proxies must be completely transparent regarding user agent access 2933 authentication. That is, they must forward the WWW-Authenticate and 2934 Authorization headers untouched. HTTP/1.0 does not provide a means 2935 for a client to be authenticated with a proxy -- this feature will 2936 be available in future versions of HTTP. 2938 Note: The names Proxy-Authenticate and Proxy-Authorization 2939 have been suggested as headers, analogous to WWW-Authenticate 2940 and Authorization, but applying only to the immediate 2941 connection with a proxy. 2943 10.1 Basic Authentication Scheme 2945 The basic authentication scheme is based on the model that the 2946 client must authenticate itself with a user-ID and a password for 2947 each realm. The realm value should be considered an opaque string 2948 which can only be compared for equality with other realms. The 2949 server will service the request only if it can validate the user-ID 2950 and password for the domain of the Request-URI. 2952 basic-challenge = "Basic" SP realm 2954 The client sends the user-ID and password (separated by a single 2955 colon ":" character) within a base64 [6] encoded-cookie in the 2956 credentials. 2958 basic-credentials = "Basic" SP basic-cookie 2959 basic-cookie = <base64 encoding of userid-password> 2960 userid-password = [ token ] ":" *text 2962 There are no optional authentication parameters for the basic 2963 scheme. For example, if the user agent wishes to send the user-ID 2964 "Aladdin" and password "open sesame", it would use the following 2965 header field: 2967 Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ== 2969 The basic authentication scheme is a non-secure method of filtering 2970 unauthorized access to resources on an HTTP server. It is based on 2971 the assumption that the connection between the client and the 2972 server can be regarded as a trusted carrier. As this is not 2973 generally true on an open network, the basic authentication scheme 2974 should be used accordingly. In spite of this, clients are strongly 2975 encouraged to implement the scheme in order to communicate with 2976 servers that use it. 2978 11. Security Considerations 2980 This section is meant to inform application developers, information 2981 providers, and users of the security limitations in HTTP/1.0 as 2982 described by this document. The discussion does not include 2983 definitive solutions to the problems revealed, though it does make 2984 some suggestions for reducing security risks. 2986 11.1 Authentication of Clients 2988 As mentioned in Section 10.1, the Basic authentication scheme is 2989 not considered to be a secure method of user authentication, nor 2990 does it prevent the Entity-Body from being transmitted in clear 2991 text across the physical network used as the carrier. HTTP/1.0 does 2992 not prevent additional authentication schemes and encryption 2993 mechanisms to be employed to increase security. 2995 11.2 Idempotent Methods 2997 The writers of client software should be aware that the software 2998 represents the user in their interactions over the net, and should 2999 be careful to allow the user to be aware of any actions they may 3000 take which may have an unexpected significance to themselves or 3001 others. 3003 In particular, the convention has been established that the GET and 3004 HEAD methods should never have the significance of taking an 3005 action. The link "click here to subscribe"--causing the reading of a 3006 special "magic" document--is open to abuse by others making a link 3007 "click here to see a pretty picture." These methods should be 3008 considered "safe" and should not have side effects. This allows the 3009 client software to represent other methods (such as POST, PUT and 3010 DELETE) in a special way, so that the user is aware of the fact 3011 that an action is being requested. 3013 11.3 Abuse of Server Log Information 3015 A server is in the position to save personal data about a user's 3016 requests which may identify their reading patterns or subjects of 3017 interest. This information is clearly confidential in nature and 3018 its handling may be constrained by law in certain countries. People 3019 using the HTTP protocol to provide data are responsible for 3020 ensuring that such material is not distributed without the 3021 permission of any individuals that are identifiable by the 3022 published results. 3024 Two header fields are worth special mention in this context: 3025 Referer and From. The Referer field allows reading patterns to be 3026 studied and reverse links drawn. Although it can be very useful, 3027 its power can be abused if user details are not separated from the 3028 information contained in the Referer. Even when the personal 3029 information has been removed, the Referer field may have indicated 3030 a secure document's URI, whose revelation itself would be a breach 3031 of security. 3033 The information sent in the From field might conflict with the 3034 user's privacy interests or their site's security policy, and hence 3035 it should not be transmitted without the user being able to 3036 disable, enable, and modify the contents of the field. The user 3037 must be able to set the active contents of this field within a user 3038 preference or application defaults configuration. 3040 We suggest, though do not require, that a convenient toggle 3041 interface be provided for the user to enable or disable the sending 3042 of From and Referer information. 3044 12. Acknowledgments 3046 This specification makes heavy use of the augmented BNF and generic 3047 constructs defined by David H. Crocker for RFC 822 [8]. Similarly, 3048 it reuses many of the definitions provided by Nathaniel Borenstein 3049 and Ned Freed for MIME [6]. We hope that their inclusion in this 3050 specification will help reduce past confusion over the relationship 3051 between HTTP/1.0 and Internet mail. 3053 The HTTP protocol has evolved considerably over the past three 3054 years. It has benefited from a large and active developer community-- 3055 the many people who have participated on the www-talk mailing list-- 3056 and it is that community which has been most responsible for the 3057 success of HTTP and of the World-Wide Web in general. 3058 Marc Andreessen, Robert Cailliau, Daniel W. Connolly, Bob Denny, 3059 Phillip M. Hallam-Baker, Haringkon W. Lie, Ari Luotonen, Rob McCool, 3060 Dave Raggett, Tony Sanders, and Marc VanHeyningen deserve special 3061 recognition for their efforts in defining aspects of the protocol 3062 for early versions of this specification. 3064 This document has benefited greatly from the comments of all those 3065 participating in the HTTPWG. In addition to those already 3066 mentioned, the following individuals have contributed to this 3067 specification: 3069 Gary Adams Harald Tveit Alvestrand 3070 Keith Ball Brian Behlendorf 3071 Paul Burchard Maurizio Codogno 3072 Mike Cowlishaw Michael A. Dolan 3073 John Franks Alex Hopmann 3074 Bob Jernigan Martijn Koster 3075 Dave Kristol Daniel LaLiberte 3076 Albert Lunde John C. Mallery 3077 Larry Masinter Mitra 3078 Gavin Nicol Marc Salomon 3079 Chuck Shotton Eric W. Sink 3080 Simon E. Spero 3082 13. References 3084 [1] H. T. Alvestrand. "Tags for the identification of languages." 3085 RFC 1766, UNINETT, March 1995. 3087 [2] F. Anklesaria, M. McCahill, P. Lindner, D. Johnson, D. Torrey, 3088 and B. Alberti. "The Internet Gopher Protocol: A distributed 3089 document search and retrieval protocol." RFC 1436, University 3090 of Minnesota, March 1993. 3092 [3] T. Berners-Lee. "Universal Resource Identifiers in WWW: A 3093 Unifying Syntax for the Expression of Names and Addresses of 3094 Objects on the Network as used in the World-Wide Web." 3095 RFC 1630, CERN, June 1994. 3097 [4] T. Berners-Lee and D. Connolly. "HyperText Markup Language 3098 Specification - 2.0." Work in Progress (draft-ietf-html-spec- 3099 01.txt), CERN, HaL Computer Systems, February 1995. 3101 [5] T. Berners-Lee, L. Masinter, and M. McCahill. "Uniform Resource 3102 Locators (URL)." RFC 1738, CERN, Xerox PARC, University of 3103 Minnesota, October 1994. 3105 [6] N. Borenstein and N. Freed. "MIME (Multipurpose Internet Mail 3106 Extensions) Part One: Mechanisms for Specifying and Describing 3107 the Format of Internet Message Bodies." RFC 1521, Bellcore, 3108 Innosoft, September 1993. 3110 [7] R. Braden. "Requirements for Internet hosts - application and 3111 support." STD 3, RFC 1123, IETF, October 1989. 3113 [8] D. H. Crocker. "Standard for the Format of ARPA Internet Text 3114 Messages." STD 11, RFC 822, UDEL, August 1982. 3116 [9] F. Davis, B. Kahle, H. Morris, J. Salem, T. Shen, R. Wang, 3117 J. Sui, and M. Grinbaum. "WAIS Interface Protocol Prototype 3118 Functional Specification." (v1.5), Thinking Machines 3119 Corporation, April 1990. 3121 [10] R. T. Fielding. "Relative Uniform Resource Locators." Work in 3122 Progress (draft-ietf-uri-relative-url-05.txt), UC Irvine, 3123 January 1995. 3125 [11] M. Horton and R. Adams. "Standard for interchange of USENET 3126 messages." RFC 1036 (Obsoletes RFC 850), AT&T Bell 3127 Laboratories, Center for Seismic Studies, December 1987. 3129 [12] B. Kantor and P. Lapsley. "Network News Transfer Protocol: A 3130 Proposed Standard for the Stream-Based Transmission of News." 3131 RFC 977, UC San Diego, UC Berkeley, February 1986. 3133 [13] K. Moore. "MIME (Multipurpose Internet Mail Extensions) Part 3134 Two: Message Header Extensions for Non-ASCII Text." RFC 1522, 3135 University of Tennessee, September 1993. 3137 [14] J. Postel. "Simple Mail Transfer Protocol." STD 10, RFC 821, 3138 USC/ISI, August 1982. 3140 [15] J. Postel. "Media Type Registration Procedure." RFC 1590, 3141 USC/ISI, March 1994. 3143 [16] J. Postel and J. K. Reynolds. "File Transfer Protocol (FTP)." 3144 STD 9, RFC 959, USC/ISI, October 1985. 3146 [17] J. Reynolds and J. Postel. "Assigned Numbers." STD 2, RFC 1700, 3147 USC/ISI, October 1994. 3149 [18] US-ASCII. Coded Character Set - 7-Bit American Standard Code for 3150 Information Interchange. Standard ANSI X3.4-1986, ANSI, 1986. 3152 [19] ISO-8859. International Standard -- Information Processing -- 3153 8-bit Single-Byte Coded Graphic Character Sets -- Part 1: Latin 3154 Alphabet No. 1, ISO 8859-1:1987. Part 2: Latin alphabet No. 2, 3155 ISO 8859-2, 1987. Part 3: Latin alphabet No. 3, ISO 8859-3, 3156 1988. Part 4: Latin alphabet No. 4, ISO 8859-4, 1988. Part 5: 3157 Latin/Cyrillic alphabet, ISO 8859-5, 1988. Part 6: Latin/Arabic 3158 alphabet, ISO 8859-6, 1987. Part 7: Latin/Greek alphabet, ISO 3159 8859-7, 1987. Part 8: Latin/Hebrew alphabet, ISO 8859-8, 1988. 3160 Part 9: Latin alphabet No. 5, ISO 8859-9, 1990. 3162 14. Authors' Addresses 3164 Tim Berners-Lee 3165 Director, W3 Consortium 3166 MIT Laboratory for Computer Science 3167 545 Technology Square 3168 Cambridge, MA 02139, U.S.A. 3169 Tel: +1 (617) 253 9670 3170 Fax: +1 (617) 258 8682 3171 Email: timbl@w3.org 3173 Roy T. Fielding 3174 Department of Information and Computer Science 3175 University of California 3176 Irvine, CA 92717-3425, U.S.A. 3177 Tel: +1 (714) 824-4049 3178 Fax: +1 (714) 824-4056 3179 Email: fielding@ics.uci.edu 3181 Henrik Frystyk Nielsen 3182 World-Wide Web Project 3183 CERN, 3184 1211 Geneva 23, Switzerland 3185 Tel: +41 (22) 767 8265 3186 Fax: +41 (22) 767 8730 3187 Email: frystyk@w3.org 3189 Appendices 3191 These appendices are provided for informational reasons only -- they 3192 do not form a part of the HTTP/1.0 specification. 3194 A. Internet Media Type message/http 3196 In addition to defining the HTTP/1.0 protocol, this document serves 3197 as the specification for the Internet media type "message/http". 3198 The following is to be registered with IANA [15]. 3200 Media Type name: message 3202 Media subtype name: http 3204 Required parameters: none 3206 Optional parameters: version, type 3208 version: The HTTP-Version number of the enclosed message 3209 (e.g. "1.0"). If not present, the version can be 3210 determined from the first line of the body. 3212 type: The message type -- "request" or "response". If 3213 not present, the type can be determined from the 3214 first line of the body. 3216 Encoding considerations: only "7bit", "8bit", or "binary" are 3217 permitted 3219 Security considerations: none 3221 B. Minimum Compliance 3223 Early reviews of this specification have indicated the need for a 3224 statement of the minimum requirements for an implementation to be 3225 considered in compliance with HTTP/1.0. This section will be 3226 written soon. 3228 Note: The primary difficulty in determining a standard for 3229 minimum compliance rests in the fact that HTTP is a flexible 3230 protocol which can be used for many purposes. The 3231 requirements for special purpose applications often differ 3232 from those of general purpose applications. 3234 B.1 Servers 3236 Servers have a special responsibility for being honest when 3237 generating their responses to requesting clients. The Status-Code 3238 sent in the Status-Line must correspond to the actual action taken 3239 by the server. This is especially the case when the method used in 3240 the request is one of PUT, POST, DELETE, LINK, and UNLINK. If a 3241 Status-Code of 200 is returned, the client must be able to assume 3242 that the action has been carried out. If the server is not able to 3243 fulfill the requested action immediately, the correct status code 3244 to use is "202 Accepted". 3246 The methods GET and HEAD must be supported by all general-purpose 3247 servers. Servers which provide Last-Modified dates for resources 3248 must also support the conditional GET method. 3250 C. Tolerant Applications 3252 While it may be appropriate for testing applications to verify full 3253 conformance to this specification, it is recommended that 3254 operational applications be tolerant of deviations. This appendix 3255 mentions the most important topics where tolerance is recommended. 3257 C.1 Request-Line, Status-Line, and Header Fields 3259 Clients should be tolerant in parsing the Status-Line and servers 3260 tolerant when parsing the Request-Line. In particular, they should 3261 accept any amount of SP and HTAB characters between fields, even 3262 though only a single SP is specified. 3264 The line terminator for HTTP-header fields should be the sequence 3265 CRLF. However, we recommend that applications, when parsing such 3266 headers, recognize a single LF as a line terminator and ignore the 3267 leading CR. 3269 We recommend that servers allocate URIs free of "variant" 3270 characters (characters whose representation differs in some of the 3271 national variant character sets), punctuation characters, and 3272 spaces. This makes URIs easier to handle by humans when the need 3273 arises (such as for debugging or transmission through non hypertext 3274 systems). 3276 D. Relationship to MIME 3278 HTTP/1.0 reuses many of the constructs defined for Internet Mail 3279 (RFC 822 [8]) and the Multipurpose Internet Mail Extensions 3280 (MIME [6]) to allow entities to be transmitted in an open variety 3281 of representations and with extensible mechanisms. However, HTTP is 3282 not a MIME-conforming application. HTTP's performance requirements 3283 differ substantially from those of Internet mail. Since it is not 3284 limited by the restrictions of existing mail protocols and 3285 gateways, HTTP does not obey some of the constraints imposed by 3286 RFC 822 and MIME for mail transport. 3288 This appendix describes specific areas where HTTP differs from 3289 MIME. Gateways to MIME-compliant protocols must be aware of these 3290 differences and provide the appropriate conversions where 3291 necessary. No conversion should be necessary for a MIME-conforming 3292 entity to be transferred using HTTP. 3294 D.1 Conversion to Canonical Form 3296 MIME requires that an entity be converted to canonical form prior 3297 to being transferred, as described in Appendix G of RFC 1521 [6]. 3298 Although HTTP does require media types to be transferred in 3299 canonical form, it changes the definition of "canonical form" for 3300 text-based media types as described in Section 8.1.1. 3302 D.1.1 Representation of Line Breaks 3304 MIME requires that the canonical form of any text type represent 3305 line breaks as CRLF and forbids the use of CR or LF outside of line 3306 break sequences. Since HTTP allows CRLF, bare CR, and bare LF (or 3307 the octet sequence(s) to which they would be translated for the 3308 given character set) to indicate a line break within text content, 3309 recipients of an HTTP message cannot rely upon receiving MIME- 3310 canonical line breaks in text. 3312 Where it is possible, a gateway from HTTP to a MIME-conformant 3313 protocol should translate all line breaks within text/* media types 3314 to the MIME canonical form of CRLF. However, this may be 3315 complicated by the presence of a Content-Encoding and by the fact 3316 that HTTP allows the use of some character sets which do not use 3317 octets 13 and 10 to represent CR and LF (as is the case for some 3318 multi-byte character sets). 3320 D.1.2 Default Character Set 3322 MIME requires that all subtypes of the top-level Content-Type 3323 "text" have a default character set of US-ASCII [18]. In contrast, 3324 HTTP defines the default character set for "text" to be 3325 ISO88591 [19] (a superset of US-ASCII). Therefore, if a text/* 3326 media type given in the Content-Type header field does not already 3327 include an explicit charset parameter, the parameter 3329 ;charset="iso-8859-1" 3331 should be added by the gateway if the entity contains any octets 3332 greater than 127. 3334 D.2 Default Content-Transfer-Encoding 3336 The default Content-Transfer-Encoding (CTE) for all MIME messages 3337 is "7bit". In contrast, HTTP defines the default CTE to be 3338 "binary". Therefore, if an entity does not include an explicit CTE 3339 header field, the gateway should apply either the "quoted-printable" 3340 or "base64" transfer encodings and add the appropriate 3341 Content-Transfer-Encoding field. At a minimum, the explicit CTE 3342 field of 3344 Content-Transfer-Encoding: binary 3346 should be added by the gateway if it is unwilling to apply a mail- 3347 safe encoding. 3349 D.3 Introduction of Content-Encoding 3351 MIME does not include any concept equivalent to HTTP's Content- 3352 Encoding header field. Since this acts as a modifier on the media 3353 type, gateways to MIME-conformant protocols should either change 3354 the value of the Content-Type header field or decode the Entity- 3355 Body before forwarding the message. 3357 Note: Some experimental applications of Content-Type for 3358 Internet mail have used a media-type parameter of 3359 ";conversions=<encoding-mechanisms>" to perform an 3360 equivalent function as Content-Encoding. However, this 3361 parameter is not part of the MIME specification at the time 3362 of this writing. 3364 E. Example of Version Control 3366 This appendix gives an example on how the Entity-Header fields 3367 Version and Derived-From can be used to apply version control to 3368 the creation and parallel development of a work. In order to 3369 simplify the example, only two user agents (A and B) are considered 3370 together with an origin server S. 3372 o A sends a POST request to S, including the header 3373 "Version: 1.0" and an entity 3375 o S replies "201 Created" to A, including the header 3376 "Version: 1.0" and a URI-header which should be used for 3377 future references 3379 o A starts editing the entity 3381 o B sends a GET request to S 3383 o S replies "200 OK" to B, including the entity with a header 3384 "Version: 1.0" 3386 o B starts editing the entity 3388 o B sends a PUT request to S, including the entity and a header 3389 "Derived-From: 1.0" 3391 o S replies "204 No Content" to B, including a header 3392 "Version: 1.1" but no entity 3394 o A sends a PUT request to S, including the entity and a header 3395 "Derived-From: 1.0" 3397 o S replies "409 Conflict" to A, including "Version: 1.1" and the 3398 list of problems with merging A's changes to 1.0 with those 3399 already applied for B and version 1.1 3401 o A merges B's changes with its own, possibly with help from the 3402 user of A 3404 o A sends a PUT request to S including the entity and the header 3405 "Derived-From: 1.1" 3407 o S replies "204 No Content" to A, including the header 3408 "Version: 1.2" but no entity 3410 The example can be expanded to any number of involved user agents, 3411 though the likelihood of conflicts and the difficulty of resolving 3412 them may increase.