Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Emit response allow restler's users to work with stream ;) #70

Merged
merged 1 commit into from

2 participants

@adriengibrat

I just needed to get response stream (to save [large] image files).
I was using restler to get some JSON API and did'nt want to use plain http just for saving a file....
The patch is very simple.

@danwrong danwrong merged commit e7d6400 into danwrong:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 0 deletions.
  1. +1 −0  lib/restler.js
View
1  lib/restler.js
@@ -205,6 +205,7 @@ mixin(Request.prototype, {
_makeRequest: function() {
var self = this;
this.request.on('response', function(response) {
+ self.emit('response', response);
self._responseHandler(response);
}).on('error', function(err) {
if (!self.aborted) {
Something went wrong with that request. Please try again.