How to use the request-promise.defaults function in request-promise

To help you get started, we’ve selected a few request-promise examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github oznu / homebridge-config-ui-x / lib / pm.js View on Github external
constructor () {
    // load base paths where plugins might be installed
    this.paths = this.getBasePaths()

    // setup requests with default options
    this.rp = rp.defaults({json: true})

    // get npm path
    this.npm = this.getNpmPath()

    // pre-load installed plugins
    this.plugins = []
    this.getInstalled()
  }
github oznu / homebridge-config-ui-x / src / pm.ts View on Github external
constructor() {
    // load base paths where plugins might be installed
    this.paths = this.getBasePaths();

    // setup requests with default options
    this.rp = rp.defaults({ json: true });

    // get npm path
    this.npm = this.getNpmPath();

    // pre-load installed plugins
    this.plugins = [];
    this.getInstalled();
  }
github xavierchow / github-label-template / lib / label.js View on Github external
constructor(owner, repo, token) {
    this.owner = owner;
    this.repo = repo;
    this.token = token;
    this.rp = request.defaults({
      baseUrl: `${GH_HOST}/repos/${this.owner}/${this.repo}`,
      headers: {
        // Opt-in into the preview version in order to be able to work with label descriptions
        // See 
        Accept: 'application/vnd.github.symmetra-preview+json',
        'user-agent': 'gh-label',
      },
      json: true
    });
  }
github iXyles / fortnite-basic-api / src / Requester.js View on Github external
constructor(client) {
    this.client = client;
    this.jar = Request.jar();

    this.options = {
      timeout: 5000,
      headers: { },
      json: true,
      jar: this.jar,
    };

    this.request = Request.defaults(this.options);
  }
github Cimpress-MCP / felix / lib / plugins / travis.js View on Github external
constructor (settings) {
    this.client = request.defaults({
      baseUrl: 'https://api.travis-ci.org',
      headers: {
        'Content-Type': 'application/json',
        'Travis-API-Version': '3',
        Authorization: `token ${settings.token}`
      },
      json: true
    });
  }

request-promise

The simplified HTTP request client 'request' with Promise support. Powered by Bluebird.

ISC
Latest version published 4 years ago

Package Health Score

55 / 100
Full package analysis