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

Return the readable stream object from request #25

Merged
merged 1 commit into from Jun 3, 2012

Conversation

dtjm
Copy link
Contributor

@dtjm dtjm commented May 13, 2012

I am using this in my project to allow streaming of the Dropbox API response to the client. This is especially useful for streaming responses from GET /files. For example (with the 0.3.x API):

var stream = dbox.get("/dropbox/file.ext", opts, function(status, fileBuffer){
    // Handle error here
});

// Write each chunk of the Dropbox API to the client connection as it comes in
stream.on("data", function(chunk){
    res.write(chunk);
});

stream.on("end", function(){
    res.end();
});

@sintaxi
Copy link
Owner

sintaxi commented May 13, 2012

This makes a lot of sense. I'm going to test out some edge cases and see how it goes.

@dtjm
Copy link
Contributor Author

dtjm commented May 13, 2012

Cool! let me know how I can help.

@sintaxi sintaxi merged commit 6de5f9c into sintaxi:master Jun 3, 2012
@ghost ghost assigned sintaxi Jul 9, 2012
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.

None yet

2 participants