How to use the @hapi/wreck.defaults function in @hapi/wreck

To help you get started, we’ve selected a few @hapi/wreck 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 elastic / kibana / test / common / services / kibana_server / ui_settings.js View on Github external
constructor(url, log, defaults, lifecycle) {
    this._log = log;
    this._defaults = defaults;
    this._wreck = Wreck.defaults({
      headers: { 'kbn-xsrf': 'ftr/services/uiSettings' },
      baseUrl: url,
      json: true,
      redirects: 3,
    });

    if (this._defaults) {
      lifecycle.on('beforeTests', async () => {
        await this.update(defaults);
      });
    }
  }
github senecajs / seneca / lib / transport.js View on Github external
function makeWreck() {
  return Wreck.defaults({
    agents: {
      http: new Http.Agent({ keepAlive: true, maxFreeSockets: Infinity }),
      https: new Https.Agent({ keepAlive: true, maxFreeSockets: Infinity }),
      httpsAllowUnauthorized: new Https.Agent({
        keepAlive: true,
        maxFreeSockets: Infinity,
        rejectUnauthorized: false
      })
    }
  })
}
github lelylan / simple-oauth2 / lib / client.js View on Github external
constructor(config) {
    const configHttpOptions = Hoek.applyToDefaults(config.http || {}, {
      baseUrl: config.auth.tokenHost,
    });

    const httpOptions = Hoek.applyToDefaults(defaultHttpOptions, configHttpOptions);

    this.config = config;
    this.client = Wreck.defaults(httpOptions);
  }

@hapi/wreck

HTTP Client Utilities

BSD-3-Clause
Latest version published 4 months ago

Package Health Score

80 / 100
Full package analysis