Hypertext Transfer Protocol -- HTTP/1 - W3

Transcription

Network Working GroupRequest for Comments: 2616Obsoletes: 2068Category: Standards TrackR. FieldingUC IrvineJ. GettysCompaq/W3CJ. C. MogulCompaqH. FrystykW3C/MITL. MasinterXeroxP. LeachMicrosoftT. Berners-LeeW3C/MITJune, 1999Hypertext Transfer Protocol -- HTTP/1.1Status of this MemoThis document specifies an Internet standards track protocol for the Internet community, and requests discussion andsuggestions for improvements. Please refer to the current edition of the “Internet Official Protocol Standards” (STD1) for the standardization state and status of this protocol. Distribution of this memo is unlimited.Copyright NoticeCopyright (C) The Internet Society (1999). All Rights Reserved.AbstractThe Hypertext Transfer Protocol (HTTP) is an application-level protocol for distributed, collaborative, hypermediainformation systems. It is a generic, stateless, protocol which can be used for many tasks beyond its use forhypertext, such as name servers and distributed object management systems, through extension of its requestmethods, error codes and headers [47]. 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 definesthe protocol referred to as “HTTP/1.1”, and is an update to RFC 2068 [33].Fielding, et alStandards Track[Page 1]

RFC 2616HTTP/1.1June, 1999Table of ContentsHYPERTEXT TRANSFER PROTOCOL -- HTTP/1.1.1Status of this Memo .1Copyright Notice.1Abstract .1Table of Contents.211.11.21.31.4Introduction .7Purpose .7Requirements .7Terminology .8Overall Operation .102.12.2Notational Conventions and Generic Grammar .11Augmented BNF .11Basic Rules .1223Protocol Parameters .133.1HTTP Version .133.2Uniform Resource Identifiers.143.2.1General Syntax.143.2.2http URL .143.2.3URI Comparison .153.3Date/Time Formats .153.3.1Full Date .153.3.2Delta Seconds .163.4Character Sets .163.4.1Missing Charset .163.5Content Codings .163.6Transfer Codings .173.6.1Chunked Transfer Coding.183.7Media Types .183.7.1Canonicalization and Text Defaults .193.7.2Multipart Types.193.8Product Tokens .203.9Quality Values .203.10Language Tags.203.11Entity Tags.203.12Range Units .2144.14.24.34.44.5HTTP Message.21Message Types.21Message Headers .21Message Body.22Message Length .23General Header Fields .23Fielding, et alStandards Track[Page 2]

RFC 2616HTTP/1.1June, 19995Request I .245.2The Resource Identified by a Request .255.3Request Header Fields .266Response .266.1Status-Line .266.1.1Status Code and Reason Phrase .266.2Response Header Fields.287Entity .287.1Entity Header Fields .287.2Entity Body.297.2.1Type .297.2.2Entity Length .298Connections .298.1Persistent Connections .298.1.1Purpose .298.1.2Overall Operation .308.1.3Proxy Servers.318.1.4Practical Considerations.318.2Message Transmission Requirements .318.2.1Persistent Connections and Flow Control .318.2.2Monitoring Connections for Error Status Messages .318.2.3Use of the 100 (Continue) Status .328.2.4Client Behavior if Server Prematurely Closes Connection .339Method Definitions .339.1Safe and Idempotent Methods .339.1.1Safe Methods .339.1.2Idempotent Methods .349.2OPTIONS .349.3GET .359.4HEAD .359.5POST .359.6PUT .369.7DELETE .369.8TRACE .379.9CONNECT .3710Status Code Definitions .3710.1Informational 1xx .3710.1.1100 Continue.3710.1.2101 Switching Protocols .3810.2Successful 2xx .3810.2.1200 OK .3810.2.2201 Created.3810.2.3202 Accepted .3810.2.4203 Non-Authoritative Information .3910.2.5204 No Content.3910.2.6205 Reset Content.3910.2.7206 Partial Content .39Fielding, et alStandards Track[Page 3]

RFC 2616HTTP/1.1June, 199910.3Redirection 3xx.4010.3.1300 Multiple Choices.4010.3.2301 Moved Permanently .4010.3.3302 Found .4010.3.4303 See Other .4110.3.5304 Not Modified .4110.3.6305 Use Proxy.4110.3.7306 (Unused) .4110.3.8307 Temporary Redirect .4210.4Client Error 4xx .4210.4.1400 Bad Request .4210.4.2401 Unauthorized.4210.4.3402 Payment Required .4210.4.4403 Forbidden.4210.4.5404 Not Found .4310.4.6405 Method Not Allowed .4310.4.7406 Not Acceptable .4310.4.8407 Proxy Authentication Required.4310.4.9408 Request Timeout .4310.4.10409 Conflict .4310.4.11410 Gone .4410.4.12411 Length Required .4410.4.13412 Precondition Failed.4410.4.14413 Request Entity Too Large .4410.4.15414 Request-URI Too Long .4410.4.16415 Unsupported Media Type .4410.4.17416 Requested Range Not Satisfiable.4410.4.18417 Expectation Failed .4510.5Server Error 5xx .4510.5.1500 Internal Server Error .4510.5.2501 Not Implemented .4510.5.3502 Bad Gateway.4510.5.4503 Service Unavailable .4510.5.5504 Gateway Timeout.4510.5.6505 HTTP Version Not Supported .4511Access Authentication.461212.112.212.3Content Negotiation.46Server-driven Negotiation.46Agent-driven Negotiation .47Transparent Negotiation .4713Caching in HTTP .4713.1.1Cache Correctness.4813.1.2Warnings.4913.1.3Cache-control Mechanisms.4913.1.4Explicit User Agent Warnings .4913.1.5Exceptions to the Rules and Warnings.5013.1.6Client-controlled Behavior.5013.2Expiration Model .5013.2.1Server-Specified Expiration.5013.2.2Heuristic Expiration .5113.2.3Age Calculations.5113.2.4Expiration Calculations.52Fielding, et alStandards Track[Page 4]

RFC .1013.1113.1213.13HTTP/1.1June, 1999Disambiguating Expiration Values .53Disambiguating Multiple Responses.53Validation Model .53Last-Modified Dates .54Entity Tag Cache Validators .54Weak and Strong Validators .54Rules for When to Use Entity Tags and Last-Modified Dates .56Non-validating Conditionals .57Response Cacheability .57Constructing Responses From Caches .57End-to-end and Hop-by-hop Headers .58Non-modifiable Headers .58Combining Headers .59Combining Byte Ranges .59Caching Negotiated Responses.60Shared and Non-Shared Caches.60Errors or Incomplete Response Cache Behavior .61Side Effects of GET and HEAD .61Invalidation After Updates or Deletions .61Write-Through Mandatory.61Cache Replacement.62History Lists.6214Header Field Definitions coding .6414.4Accept-Language .6514.5Accept-Ranges .6614.6Age.6614.7Allow .6614.8Authorization .6614.9Cache-Control.6714.9.1What is Cacheable .6814.9.2What May be Stored by Caches .6914.9.3Modifications of the Basic Expiration Mechanism .6914.9.4Cache Revalidation and Reload Controls.7014.9.5No-Transform Directive.7214.9.6Cache Control ng .7314.12Content-Language.7314.13Content-Length .7414.14Content-Location .7414.15Content-MD5 .7514.16Content-Range .7514.17Content-Type .7714.18Date.7714.18.1Clockless Origin Server Operation .7814.19ETag .7814.20Expect .7814.21Expires .7814.22From.7914.23Host.7914.24If-Match .80Fielding, et alStandards Track[Page 5]

RFC .4114.4214.4314.4414.4514.4614.47HTTP/1.1June, 1999If-Modified-Since .80If-None-Match .81If-Range .82If-Unmodified-Since .82Last-Modified .83Location .83Max-Forwards.83Pragma .84Proxy-Authenticate .

RFC 2616 HTTP/1.1 June, 1999