HTTP Working Group R. Fielding, UC Irvine INTERNET-DRAFT J. Gettys, Digital J. C. Mogul, Digital L. Masinter, Xerox P. Leach, Microsoft H. Frystyk, MIT/LCS T. Berners-Lee, MIT/LCS Expires May 21, 1998 November 21, 1997 Hypertext Transfer Protocol -- HTTP/1.1 Status of this Memo This document is an Internet-Draft. Internet-Drafts are working documents of the Internet Engineering Task Force (IETF), its areas, and its working groups. Note that other groups may also distribute working documents as Internet-Drafts. Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or made obsolete by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress". To learn the current status of any Internet-Draft, please check the "1id-abstracts.txt" listing contained in the Internet-Drafts Shadow Directories on ftp.is.co.za (Africa), nic.nordu.net (Europe), munnari.oz.au (Pacific Rim), ds.internic.net (US East Coast), or ftp.isi.edu (US West Coast). Distribution of this document is unlimited. Please send comments to the HTTP working group at . Discussions of the working group are archived at . General discussions about HTTP and the applications which use HTTP should take place on the mailing list. Abstract The Hypertext Transfer Protocol (HTTP) is an application-level protocol for distributed, collaborative, hypermedia information systems. It is a generic, stateless, object-oriented protocol which can be used for many tasks, such as name servers and distributed object management systems, through extension of its request methods. A feature of HTTP is the typing and negotiation of data representation, allowing systems to be built independently of the data being transferred. HTTP has been in use by the World-Wide Web global information initiative since 1990. This specification defines the protocol referred to as "HTTP/1.1". The issues list for HTTP/1.1 can be found at: http://www.w3.org/Protocols/HTTP/Issues/. Fielding, et al [Page 1] INTERNET-DRAFT HTTP/1.1 Friday, November 21, 1997 This draft does not resolve all open issues in the HTTP/1.1 specification requiring closure before HTTP/1.1 goes to draft standard. It does, however, close most of them, and note where in the document there are still significant issues under discussion. The best way to view this document is to get a copy of the Word 97 document found at: http://www.w3.org/Protocols/HTTP/1.1/draft-ietf-http-v11-spec-rev- 01.doc; all issues are noted as comments in the source document, with hyperlinks to the Issues list. This document has had the basic ambiguity problems with OPTIONS resolved; but does not solve the underlying issue of identifying extensions to HTTP. The issue OPTIONS is therefore still open; at Munich, there was strong sentiment to some sort of OPTIONS facility, but we've not been able to converge; it is on the agenda for Washington. See draft-ietf-http-options-02.txt for details. Summary Of Issues since Rev-01 (Rev-01 and Auth-00 under preparation) 4 Open Technical issues: RE-AUTHENTICATION-REQUESTED, PROXY-REDIRECT, CONTENT-ENCODING, OPTIONS. Minimal OPTIONS is in Rev-01, PROXY-REDIRECT proposal that was in Rev-00 draft (which interacts with OPTIONS) was removed from rev-01. 8 Open Editorial issues: XREFS, REQUEST_TARGET, UPDATE_ACKS, DISPOSITION, REQUIREMENTS, CLEAN_INDEXES, CODE_REGISTRY, IANA_DIRECTIONS. 4 Ready for Last Call: PUT-RANGE, RE-AUTHENTICATION-REQUESTED, TRAILER_FIELDS, RANGE_WITH_CONTENTCODING. 12 Last call issues (all edited into Rev-01): DIGEST_SYNTAX, PROTECTION_SPACE, CONTRADICTION, IMS_INM_MISMATCH, CONNECTION_METHOD, BYTERANGE_SYNTAX, RE-VERSION, HOST, AUTH-CHUNKED, REQUIRE-DIGEST, DOCKDIGEST, GENERIC_MESSAGE. 9 Technical Issues closed since Rev-00 (all edited into Rev-01): 301- 302, REDIRECTS, CACHING-CGI, WARNINGS, DATE-IF-MODIFIED, 403VS404, AGE- CALCULATION (Yeah!), VARY, RANGE-ERROR. 12 Editorial issues closed since Rev-00 (all edited into Rev-01): REMOVE_19.6, GENERIC_MESSAGE, RANGE_OPTIONAL, EBNF, CODES, UTF-8, DOCKDIGEST, URL-SYNTAX, 1310_CACHE, MESSAGE-BODY, LENGTH_WORDING, CLEANUP. Fielding, et al [Page 2] Table of Contents HYPERTEXT TRANSFER PROTOCOL -- HTTP/1.1....................1 Status of this Memo........................................1 Abstract...................................................1 Table of Contents..........................................3 1 Introduction ..........................................8 1.1 Purpose .............................................8 1.2 Requirements ........................................9 1.3 Terminology ........................................10 1.4 Overall Operation ..................................13 2 Notational Conventions and Generic Grammar ...........14 2.1 Augmented BNF ......................................14 2.2 Basic Rules ........................................16 3 Protocol Parameters ..................................17 3.1 HTTP Version .......................................17 3.2 Uniform Resource Identifiers .......................19 3.2.1 General Syntax ..................................19 3.2.2 http URL ........................................19 3.2.3 URI Comparison ..................................20 1.3 Date/Time Formats ..................................20 1.3.1 Full Date .......................................20 1.3.2 Delta Seconds ...................................21 1.4 Character Sets .....................................21 1.5 Content Codings ....................................22 1.6 Transfer Codings ...................................23 1.6.1 Chunked Transfer Coding .........................24 1.6.2 Identity Transfer Coding ........................25 1.7 Media Types ........................................25 1.7.1 Canonicalization and Text Defaults ..............26 1.7.2 Multipart Types .................................26 1.8 Product Tokens .....................................27 1.9 Quality Values .....................................27 1.10 Language Tags ......................................28 1.11 Entity Tags ........................................28 1.12 Range Units ........................................29 4 HTTP Message .........................................29 4.1 Message Types ......................................29 4.2 Message Headers ....................................30 4.3 Message Body .......................................30 4.4 Message Length .....................................31 4.5 General Header Fields ..............................32 Fielding, et al [Page 3] INTERNET-DRAFT HTTP/1.1 Friday, November 21, 1997 5 Request ..............................................33 5.1 Request-Line .......................................33 5.1.1 Method ..........................................33 5.1.2 Request-URI .....................................34 5.2 The Resource Identified by a Request ...............35 5.3 Request Header Fields ..............................35 6 Response .............................................36 6.1 Status-Line ........................................36 6.1.1 Status Code and Reason Phrase ...................36 1.2 Response Header Fields .............................38 7 Entity ...............................................39 7.1 Entity Header Fields ...............................39 7.2 Entity Body ........................................39 7.2.1 Type ............................................40 7.2.2 Length ..........................................40 8 Connections ..........................................40 8.1 Persistent Connections .............................40 8.1.1 Purpose .........................................40 1.1.2 Overall Operation ...............................41 1.1.3 Proxy Servers ...................................42 1.1.4 Practical Considerations ........................43 1.2 Message Transmission Requirements ..................44 1.2.1 Persistent connections and flow control .........44 1.2.2 Monitoring connections for error status messages 44 1.2.3 Automatic retrying of requests ..................44 1.2.4 Use of the 100 (Continue) status ................44 1.2.5 Client behavior if server prematurely closes connection .................................................46 9 Method Definitions ...................................47 9.1 Safe and Idempotent Methods ........................47 9.1.1 Safe Methods ....................................47 9.1.2 Idempotent Methods ..............................48 9.2 OPTIONS ............................................48 9.3 GET ................................................49 9.4 HEAD ...............................................50 9.5 POST ...............................................50 1.6 PUT ................................................51 1.6.1 Partial PUT (PUT with Content-Range) ............52 1.7 DELETE .............................................53 1.8 TRACE ..............................................53 1.9 CONNECT ............................................54 10 Status Code Definitions .............................54 10.1 Informational 1xx ..................................54 10.1.1 100 Continue ....................................54 10.1.2 101 Switching Protocols .........................54 10.2 Successful 2xx .....................................55 Fielding, et al [Page 4] INTERNET-DRAFT HTTP/1.1 Friday, November 21, 1997 10.2.1 200 OK ..........................................55 10.2.2 201 Created .....................................55 10.2.3 202 Accepted ....................................55 10.2.4 203 Non-Authoritative Information ...............56 10.2.5 204 No Content ..................................56 10.2.6 205 Reset Content ...............................56 10.2.7 206 Partial Content .............................57 10.2.8 207 Partial Update OK ...........................57 10.3 Redirection 3xx ....................................58 10.3.1 300 Multiple Choices ............................58 10.3.2 301 Moved Permanently ...........................58 10.3.3 302 Found .......................................59 10.3.4 303 See Other ...................................59 10.3.5 304 Not Modified ................................60 10.3.6 305 Use Proxy ...................................61 10.3.7 307 Temporary Redirect ..........................61 10.4 Client Error 4xx ...................................61 10.4.1 400 Bad Request .................................62 10.4.2 401 Unauthorized ................................62 10.4.3 402 Payment Required ............................62 10.4.4 403 Forbidden ...................................62 10.4.5 404 Not Found ...................................62 10.4.6 405 Method Not Allowed ..........................63 10.4.7 406 Not Acceptable ..............................63 10.4.8 407 Proxy Authentication Required ...............63 10.4.9 408 Request Timeout .............................63 10.4.10 ......................................409 Conflict 64 10.4.11 ..........................................410 Gone 64 10.4.12 ...............................411 Length Required 64 10.4.13 ...........................412 Precondition Failed 65 10.4.14 ......................413 Request Entity Too Large 65 10.4.15 ..........................414 Request-URI Too Long 65 10.4.16 ........................415 Unsupported Media Type 65 10.4.17 ...............416 Requested range not satisfiable 65 10.4.18 ............................417 Expectation Failed 66 10.4.19 .....................418 Reauthentication Required 66 10.4.20 ...............419 Proxy Reauthentication Required 66 10.5 Server Error 5xx ...................................67 10.5.1 500 Internal Server Error .......................67 10.5.2 501 Not Implemented .............................67 10.5.3 502 Bad Gateway .................................67 10.5.4 503 Service Unavailable .........................67 10.5.5 504 Gateway Timeout .............................67 10.5.6 505 HTTP Version Not Supported ..................68 10.5.7 506 Partial Update Not Implemented ..............68 11 Access Authentication ...............................68 11.1 Digest Authentication ..............................68 12 Content Negotiation .................................68 12.1 Server-driven Negotiation ..........................69 Fielding, et al [Page 5] INTERNET-DRAFT HTTP/1.1 Friday, November 21, 1997 12.2 Agent-driven Negotiation ...........................70 12.3 Transparent Negotiation ............................70 13 Caching in HTTP .....................................71 1.1.1 Cache Correctness ...............................72 1.1.2 Warnings ........................................73 1.1.3 Cac