Skip to content

Commit

Permalink
add .abort(). Closes #115
Browse files Browse the repository at this point in the history
  • Loading branch information
tj committed Sep 17, 2012
1 parent 9898423 commit dd583ce
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions lib/superagent.js
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,19 @@
Request.prototype = new Emitter;
Request.prototype.constructor = Request;

/**
* Abort the request.
*
* @return {Request}
* @api public
*/

Request.prototype.abort = function(){
this.xhr.abort();
this.emit('abort');
return this;
};

/**
* Set header `field` to `val`, or multiple fields with one object.
*
Expand Down

0 comments on commit dd583ce

Please sign in to comment.