Closed venil7 closed 8 years ago
@venil7 great suggestion, I'd be more than happy to expose a headers
method to the request chain that lets you set/get an object containing the header values to be used.
I imagine it would work like this:
client
.post('YOUR_PROXY_URL')
.headers({
// define custom header values here
})
.send({
event_collection: 'pageviews',
timeframe: 'this_14_days'
})
.then(function(res){
// do something with the result
})
.catch(function(err){
// catch and handle errors
});
How does that look?
yes, that's exactly what I'm expecting, great!
I'd like to be able to set custom headers on all outgoing requests, to provide my proxy to cache these requests