What Are the Differences Between Empty Body and No Body in HTTP/2?
In HTTP/2, there is a subtle difference between sending an empty body and no body at all. This distinction can be observed in Cloudflare Workers when dealing with HTTP payloads. While in HTTP/1.1 a request with no body is equivalent to one with an empty body, there's a difference in HTTP/2: a "no body" request sets the END_HEADERS & END_STREAM flags on the HTTP/2 stream, whereas an "empty body" will result in only END_HEADERS (at least in the cURL implementation). This can lead to requests being treated differently, especially when they don't include a Content-Length header.
Company
Hookdeck
Date published
Aug. 9, 2022
Author(s)
Valérian Galliat
Word count
1961
Language
English
Hacker News points
None found.