Commit d3c4b4b3 authored by Ty Abonil's avatar Ty Abonil
Browse files

fixed typos in README

parent 9dc98e00
Loading
Loading
Loading
Loading
+8 −9
Original line number Diff line number Diff line
@@ -2,12 +2,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`.
[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`.

## Installation

`npm install request-promise`

## Examples

``` js
var rp = require('request-promise'), 
var rp = require('request-promise');

rp('http://www.google.com')
    .then(console.dir)
@@ -26,20 +30,15 @@ rp(options)

//displays response from server after post

options.transform : function (data) { return data.length ;}
options.transform = function (data) { return data.length ;};

rp(options)
    .then(console.dir)
    .catch(console.error);

//transform is called just before promise is fulfilled
//displays lengthg of response from server after post
//displays length of response from server after post

```

## Installation

`npm install request-promise`


## MIT Licenced
 No newline at end of file