c++ – how do i reliably read all data when content_length and Transfer_encoding: chunked isnt present? (boost asio)

My code uses the content_length header which seems fine for HTTP/1.1 but this isn’t viable in HTTP/2 where the header isn’t mandatory.

www.rfc-editor.org/rfc/rfc9113.html mentions END_STREAM but i cant seem to read it (or tcp frames) with boost::asio’s async_read_some.

How would you read a http/2 request in boost::asio without access to such headers?

I have considered reading until EOF error but i dont know if thats good practice.

I have looked into message_flags and OOB data but no luck. :<

Read more here: Source link