Заголовки ответа HTTP действительны без Transfer-Encoding и Content-Length?
Является ли заголовок ответа HTTP (как показано ниже) законным, даже если он не содержит Content-Length или Transfer-Encoding?
- Http: Response, HTTP/1.1, Status: Ok, URL: /AAA/B.json
ProtocolVersion: HTTP/1.1
StatusCode: 200, Ok
Reason: OK
Expires: Fri, 05 Oct 2012 01:41:30 GMT
Date: Fri, 05 Oct 2012 01:40:46 GMT
Vary: Accept-Encoding
Accept-Ranges: bytes
Cache-Control: public, max-age=43
Server: Noelios-Restlet-Engine/1.1.10
ContentType: application/json;charset=UTF-8
ContentEncoding: gzip
Connection: close
X-Served-By: 85.111
HeaderEnd: CRLF
Я ожидал увидеть либо Content-Length, либо Transfer-Encoding, но ни один из них не существует.
Я прочитал HTTP-RFC, но все еще не уверен.
@CodeCaster, я прочитал RFC 4.4, но до сих пор неясно, как вы можете видеть, заголовок ответа используется для возврата потока json, поэтому:
section 4.4, rule 1 defines MUST NOT include a message-body, does not seem to apply to my case. section 4.4, rule 4, not sure about this, but since I do not see "multipart/byteranges" in the response header - does it mean this rule is not applicable for me? section 4.4 rule 5, this is mostly unclear to me since the header actual contain "Connection : close", is it related?Итак, есть еще комментарии?