2.0.0 • Published 5 years ago

superagent-promise-headers v2.0.0

Weekly downloads
4
License
ISC
Repository
github
Last release
5 years ago

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