Trying to POST with retries using form-data package causes retries to fail with unhandledRejections and timeouts. The reason seems to be that form-data is a stream-like object which has reached the end in the first request. This can be worked around by buffering the form-data, for example by using get-stream package, which is ok in my case. However, maybe there could be a more elegant solution / error handling in this case?
Describe the bug
Trying to POST with retries using
form-data
package causes retries to fail with unhandledRejections and timeouts. The reason seems to be that form-data is a stream-like object which has reached the end in the first request. This can be worked around by buffering the form-data, for example by usingget-stream
package, which is ok in my case. However, maybe there could be a more elegant solution / error handling in this case?Code to reproduce
Server responding with 503:
Requesting:
Output with trace warnings:
Checklist