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

Accept readable streams as "body" #30

Merged
merged 1 commit into from
Apr 22, 2017
Merged

Conversation

bendrucker
Copy link
Collaborator

The examples imply this functionality exists:

https://github.com/feross/simple-get#form-data

FormData returns a Readable, not a Buffer. The form data example will cause Node to throw with a "first argument must be a buffer or string" error when req.end is called with the stream.

I needed simple-get with support for streaming bodies at some point and ended up writing/publishing this:

https://github.com/bendrucker/stream-post

For supporting both streams and strings/buffers through the same interface accepting {body: readable} is the smallest working change.

@feross feross merged commit f367bc4 into feross:master Apr 22, 2017
@feross
Copy link
Owner

feross commented Apr 22, 2017

Perfect PR, thanks! Released as 2.6.0. I also added you as a collaborator to this repo since your PR was great.

@bendrucker bendrucker deleted the stream-body branch October 20, 2017 21:53
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

Successfully merging this pull request may close these issues.

2 participants