Content-length in response of write requests

influxdb
#1

It seems that the HTTP response from a POST to the /write end point does not include a Content-Length: header. This is unfortunate when you’re trying to do HTTP/1.1 and want to stream the HTTP requests through a single connection. Without the content length in the response, I can’t tell when the response is complete unless the connection closes. But with HTTP/1.1 and no “Connection: close” header, we never do…

Upon closer look, it seems to be when the status is “204 No Content” and there will be no response body. I can’t really figure out from the RFC whether it would not also need a Content-Length: 0 header to emphasize that.

#2

From rfc2616:

The 204 response MUST NOT include a message-body, and thus is always
terminated by the first empty line after the header fields.

So I think this header is not required in the case of 204.

#3

The later RFC’s are also somewhat vague and seem to navigate around the existing implementations and focus more on what you do when the server does supply a body. It’s kind of nasty that the client must keep a list of status codes that are known not to have a body. Can’t really blame InfluxDB for this. Thanks. Rob