Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
A wrapper for Mikeals request module, that returns a promise
JavaScript
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
README.md
main.js
package.json

README.md

A wrapper for Mikeals request module, that returns a promise

Usually you can use promised-io.promise.convertNodeAsyncFunction to convert any function to a promise returning function. But convertNodeAsyncFunction is smart and figures out that request returns two success values - response and body - and therefore emits an array. since you can get to the body argument of request also by response.body, that is the only success value you need. and that is what this wrapper method does.

Usage:

var request = require( 'promised-request' );
request( 'http://sifu.io' ).then( function( response ) { console.info( response.body ) } );
Something went wrong with that request. Please try again.