Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add RequestBody.fromBuffer #15

Closed
pete-murphy opened this issue Sep 4, 2023 · 2 comments
Closed

Add RequestBody.fromBuffer #15

pete-murphy opened this issue Sep 4, 2023 · 2 comments

Comments

@pete-murphy
Copy link

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-fetchjs-fetch.

@natefaubion
Copy link
Contributor

natefaubion commented Sep 4, 2023

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.

@pete-murphy
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants