This works with request.promise:
var rp = require('request-promise')
var r1 = rp.defaults({json:true})
var r2 = r2.defaults({ baseUrl: "http://localhost" })
But not with request-promise-retry:
var rp = require('request-promise-retry');
var rp1 = rp.defaults({json:true});
var rp2 = rp1.defaults({ baseUrl: "http://localhost" })
The case of "double defaults" comes up with a module defines it's own defaults, but also allows you to pass in your own request object which may also have defaults. The node-strava-v3 module works like this.
It would be a welcome addition if request-promise matched the request-promise behavior here.
Thanks.
This works with
request.promise:But not with
request-promise-retry:The case of "double defaults" comes up with a module defines it's own defaults, but also allows you to pass in your own request object which may also have defaults. The
node-strava-v3module works like this.It would be a welcome addition if
request-promisematched therequest-promisebehavior here.Thanks.