Commit 7f0e93b1 authored by Ty Abonil's avatar Ty Abonil
Browse files

exposed more info in a reject object, bumped version to 0.1

parent 78408f8f
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -4,6 +4,16 @@ A Promises/A XHR wrapper for Bluebird and Request

[Bluebird](https://github.com/petkaantonov/bluebird) and [Request](https://github.com/mikeal/request) are pretty awesome, but I found myself using the same design pattern.  This is a simple wrapper that takes in a request options object (or URI string), and returns a chainable promise.  By default, http response codes other than 200 and 201 will cause the promise to be rejected.  This can be over-ridden by setting `options.simple` to `false`.

Note: As of version 0.1, `reject` now passes  an object containing the following:
```js    
    reject({
                    error: body,
                    options: c,
                    response: response,
                    statusCode: response.statusCode
                });
```

## Installation

`npm install request-promise`
+1 −1
Original line number Diff line number Diff line
{
  "name": "request-promise",
  "version": "0.0.4",
  "version": "0.1.0",
  "description": "Promise-based Wrapper for XHR using Request and Bluebird",
  "main": "./lib/rp.js",
  "scripts": {