0

I am learning to http module of nodejs. I found a section in the documentation that says:

The interface is careful to never buffer entire requests or responses

Does it means that this module is not capable of receiving / sending the whole request / response at once and it receives / sends in chunks instead?

k0pernikus
  • 60,309
  • 67
  • 216
  • 347
Stack Overflow
  • 1
  • 5
  • 23
  • 51

1 Answers1

2

Does it means that this module is not capable of receiving / sending the whole request / response at once and it receives / sends in chunks instead?

That's correct: http is based on streams, just like the underlying net module.

There are plenty of modules available to abstract these streams away for you, and do offer receiving the response in its entirity (in memory, so be careful with large responses). For example, request and http.min.

robertklep
  • 198,204
  • 35
  • 394
  • 381