0

I am studying NodeJS and I have learned about streams and buffer. I found it very interesting because it occurred to me to use it on an HTTP server, since if a request is too big, the data can be sent little by little, especially when using the verb POST to upload big files for example. The problem is that not all data (files at this case) is very big. Is there a way to know the size of a request before it reaches its destination?

Diesan Romero
  • 1,292
  • 4
  • 20
  • 45

1 Answers1

1

From the receiving end, you can look at the Content-Length header.

It may or may not be present, depending upon the sender. For info about that, see Is the Content-Length header required for a HTTP/1.0 response?.

jfriend00
  • 683,504
  • 96
  • 985
  • 979