N
N
Nadim Zakirov2021-09-03 12:28:35
HTTP headers
Nadim Zakirov, 2021-09-03 12:28:35

How is the Content-Length header value calculated?

I never thought about it, but today I suddenly wondered, what exactly does Content-Length mean? Only the size of the request body, or does it show the size of the entire request, i.e. service headers + body?

PS The documentation says that this is the size of the request body, but it does not say whether the service headers refer to the body!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Developer, 2021-09-03
@zkrvndm

Content-length indicates the size of the Body.
Those. it could very well be size zero even with a bunch of headers and status.
For such simple questions, there is always Google and documentation
https://developer.mozilla.org/en-US/docs/Web/HTTP/...
The answer is hardcoded in the name itself - "Content length"

The documentation says that this is the size of the request body, but it does not say whether service headers refer to the body!

The documentation says that there are headers and a request body separately from them. These are different entities.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question