Skip to content

compatibility issue with request-promise: request.defaults is not supported. #8

Description

@markstos

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions