…requestParams`. For GET and DELETE requests, the parameters are added to the query string. For POST and PUTs, where there is no request body or the request body is urlencoded, the parameters are added to the request body.
These are based on the test cases for `node-oauth`, where applicable.
Assumes Node.js (for the `crypto` and `querystring` libraries). Tested against Twitter, no automated test cases yet.
* Move `error` event handlers to `client` object. This is the actual stream which emits the `error` events. * Clarify how the timeout handler is used * Close the `client` after receiving the response body, we won't reuse it anyway * Ignore `close` events on the `client`, we're the only ones closing it
…y rethrows the error. This way the internal deferred is handled (i.e. no uncaught exception will be thrown). We return a new deferred anyway, so error handling is done on that deferred, or if it isn't, an uncaught exception will be thrown.
…back. This causes an uncaught exception to be thrown because the error isn't handled on the whenPromise itself, but it is handled later as it bubbles through the promises.