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

To help you get started, we’ve selected a few request-promise-native 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 Azure / autorest.testserver / legacy / coverage / github.js View on Github external
constructor(githubRepo, githubTokenOfCI) {
    this.githubRepo = githubRepo;
    this.request = req.defaults({
      headers: {
        "User-Agent": "AutoRest CI",
        "Authorization": "token " + githubTokenOfCI
      }
    });
  }
github dave-atx / homebridge-platform-smartac / index.js View on Github external
constructor(username, password, log) {
    this.username = username;
    this.password = password;
    this.lastLogin = new Date(1970, 1, 1);
    this.lastUpdate = new Date(1970, 1, 1);
    this.thermostats = new Map();
    this.session = rp.defaults({ gzip:true, jar:true });
    this.log = log;
    this.lock = new Lock();
  }
github kamikat / bilibili-get / lib / extractor.js View on Github external
var setRequestOptions = function (options = {}) {
  options = Object.assign({
    gzip: true,
    resolveWithFullResponse: true,
  }, options);
  options.headers = Object.assign({
    'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36'
  }, options.headers);
  request = require('request-promise-native').defaults(options);
};
github bubenshchykov / ngrok / index.js View on Github external
async function connect (opts) {
  opts = defaults(opts);
  validate(opts);
  if (opts.authtoken) {
    await setAuthtoken(opts);
  }

  processUrl = await getProcess(opts);
  internalApi = request.defaults({baseUrl: processUrl});
  return connectRetry(opts);
}
github pnp / office365-cli / src / request.ts View on Github external
constructor() {
    this.req = request.defaults({
      headers: {
        'user-agent': `NONISV|SharePointPnP|Office365CLI/${packageJSON.version}`
      },
      gzip: true
    });
  }

request-promise-native

The simplified HTTP request client 'request' with Promise support. Powered by native ES6 promises.

ISC
Latest version published 4 years ago

Package Health Score

49 / 100
Full package analysis