This is a beginning to a solution for issue #59, to add the ability to abort an inflight request.
I doubt this change is sufficient, but it's the beginning of the direction I was thinking, and wanted to get feedback. I've tested all three cases locally:
All three worked. I have not added any tests to the pull request, because I wanted to get feedback first, but I will before it is merged.
Add abort support to the returned request
.abort() should be a prototype method that checks for this.req and this.response.
abort() should not emit an error.
Fair enough on the first phone.
What should it do? Whoever asked to be notified regarding resolution of the request needs to know that it is no longer functioning, IMO. This also keeps it in line with what XHR (and as such, jQuery) does when abort() is invoked.
Move abort to a prototype method, don't raise error
Merge branch 'master' of git://github.com/mikeal/request
OK, fixed per feedback. What's left:
I guess no tests necessary?
i want this in, nao! :)