Add `RequestBody.fromBuffer`
pete-murphy opened this issue · 2 comments
Similar to #12 and I think further motivating #14: I'm wanting to use fetch in a Node setting and would like to pass a Buffer (from purescript-node-buffer) as the request body. I could make a PR to do so, but understandable if you'd prefer to avoid any node-* dependencies until this is migrated from web-fetch → js-fetch.
I don't think this library should have node specific dependencies regardless. The point of moving to js-fetch is that it's portable between both environments. If you introduce a node specific dependency (ie, node:buffer), it's no longer portable. I think that a hypothetical fromBuffer should be in a node-fetch library.
That makes sense. Really I'm trying to use this via the higher-level purescript-fetch library, so probably node-fetch could wrap that, and both this library and purescript-fetch could remain portable.