úterý 20. března 2012

HTTP requirements for responses

Here I am going to make a summary of what is required in HTTP responses according to HTTP/1.1 rfc.
There are SHOULDs and MAYs in rfc, which I omit from  my table as I will check only required restrictions.
source: http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10 :


response's status codeMUST NOTMUST
204 No Contentinclude message-body
205 Reset Contentinclude an entity
206 Partial Contentinclude other entity-headers if the response is the result of an If-Range request that used a weak validatorinclude
  • Content-Range header or multipart/byteranges Content-Type including Content-Range fields for each part.
  • If a Content-Length header field is present, it MUST match the actual number of OCTETs transmitted in the message-body.
  • Date
  • ETag and/or Content-Location, if the header would have been sent in a 200 response to the same request
  • Expires, Cache-Control, and/or Vary, if the field-value might differ from that sent in any previous response for the same variant
304 Not Modified
  • contain a message-body
  • include other entity-headers if weak validator
include
  • Date, unless its omission is required by section 14.18.1
  • ETag and/or Content-Location, if the header would have been sent in a 200 response to the same request
  • Expires, Cache-Control, and/or Vary, if the field-value might differ from that sent in any previous response for the same variant
401 Unauthorizedinclude a WWW-Authenticate header field
405 Method Not Allowedinclude an Allow header containing a list of valid methods for the requested resource.
416 Requested Range Not Satisfiableresponse MUST NOT use the multipart/byteranges content- type

Žádné komentáře:

Okomentovat