Lesson 3.2
Reading the body by content-length
How the header block tells you a body's exact size, why you slice exactly that many octets and no more, and the buffered body helpers the parser fills.
What you will build
- Compute a body's byte range as the half-open interval [bodyStart, bodyStart + content-length).
- Explain why reading to the end of the buffer corrupts a pipelined request, and slice exactly content-length instead.
- Add the READ_BODY phase to the parser and the buffered buffer()/text() helpers to Request.