Is the HTTP response header (e.g. below) legal even if it doesn't have Content-Length or 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
I expected to see Content-Length or Transfer-Encoding, but none of them exist.
I read HTTP-RFC, but I'm still not sure.
@CodeCaster, I read the RFC section 4.4, but it is still not clear, as you can see, the response header is used to return the json stream, therefore:
- section 4.4, rule 1 defines it MUST NOT include the body of the message, it does not seem to be relevant to my case.
- section 4.4, rule 4, is not sure about this, but since I do not see "multipart / byteranges" in the response header - does this mean that this rule does not apply to me?
- section 4.4, rule 5, this is mostly incomprehensible to me, since the title is "Connection: close", is this connected?
So, any further comments?
user1721757
source share