Home / Companies / Hookdeck / Blog / Post Details
Content Deep Dive

What Are the Differences Between Empty Body and No Body in HTTP/2?

Blog post from Hookdeck

Post Details
Company
Date Published
Author
Valérian Galliat
Word Count
1,961
Company Posts That Month
6
Language
English
Hacker News Points
-
Post removed?
No
Summary

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.

Trends Found in this Post

No tracked trend matches for this post yet.

Use This Data

Use this post, company, and trend context to find content marketing opportunities, perform competitive analysis, or address product feature gaps via the Plushcap MCP server or the Plushcap API.