service-workers
service-workers copied to clipboard
Mock request.body isn't a ReadableStream
MDN says of request.body
A simple getter used to expose a ReadableStream of the body contents.
In particular, I would expect const { value, done } = await request.body.getReader().read()
to work.
See ReadableStream for more info.
@jamesarosen have you found any alternative solution? :)
Since Request
implements Body
, try the Body API, e.g. await request.text()
.
hi @jamesarosen thanks for the reply :) Unfortunately my production code needs a readable stream :(