undici icon indicating copy to clipboard operation
undici copied to clipboard

Request Body as Factory Method

Open ronag opened this issue 4 years ago • 5 comments

Allow passing a factory method as body which would return a Readable. This would allow e.g. idempotent PUT requests which e.g. read from a file to be part of the indirect inflight failure retries.

Alternatively an async generator function which is retryable by definition.

ronag avatar May 13 '20 12:05 ronag

It would be nice. However unlikely to work in most cases as the body can not be fetched more than once.

mcollina avatar May 13 '20 13:05 mcollina

It would be nice. However unlikely to work in most cases as the body can not be fetched more than once.

If it's being read from a file or from an upstream request... it could be

ronag avatar May 13 '20 13:05 ronag

Can we close this? https://github.com/nodejs/undici/pull/848

szmarczak avatar Jul 27 '21 13:07 szmarczak

Not quite.

ronag avatar Jul 27 '21 15:07 ronag

What is left to do here?

szmarczak avatar Jul 27 '21 18:07 szmarczak