Skip to content Skip to sidebar Skip to footer

How To Detect End Of Http Request?

I am creating a Http request parser. I am getting data in chunks (byte array) and parsing it simultaneously. I want to know the condition of detecting end of http request. The requ

Solution 1:

Three different ways:

  • content-length header (number of bytes following the headers)

  • chunked encoding (content length unknown at start of request, chunked encoding will indicate when the end is reached)

  • connection closed by server (http "0.9")

Post a Comment for "How To Detect End Of Http Request?"