Am testing with a client who send me a HTTP request with no content length header but has a content.
How do I extract this content without the help of contentlength head
If this were a response then the message could be terminated by closing the connection. But that's not an option here because the client still needs to read the response.
Apart from Content-Length:
, the other methods of determining content length are:
Transfer-Encoding: chunked
Hopefully it's the former, in which case the request should look something like this:
POST /some/path HTTP/1.1 Host: www.example.com Content-Type: text/plain Transfer-Encoding: chunked 25 This is the data in the first chunk 1C and this is the second one 3 con 8 sequence 0
(shamelessly stolen from the Wikipedia article and modified for a request)