superagent-promise-headers

2.0.0 • Public • Published

superagent-promise-headers

SuperAgent Bluebird promises - header extension

Node Version 6.9.x

What

- Adding headers to HTTP request.
- Converting superagent to `Bluebird` promise.

How

 
var request = require('superagent-promise-headers')({
    headers: {
        base: { 'content-service': 'Doron-Service' },
        get: { 'content-service-type': 'Doron-Service-GET' },
        post: { 'content-service': 'Doron-Service-POST' },
        del: { 'content-service': 'Doron-Service-DELETE' },
        put: { 'content-service': 'Doron-Service-PUT' }
    }
});
 
request
.get('http://google.com')
.then(function(res){
    // Success
    console.log(res);
}).catch(function(e){
    //Failure
    console.log(e.res);
});
 

issues?

Just checkout the github issue page Github

Package Sidebar

Install

npm i superagent-promise-headers

Weekly Downloads

1

Version

2.0.0

License

ISC

Unpacked Size

19.4 kB

Total Files

7

Last publish

Collaborators

  • doron2402