How to use the https.request function in https

To help you get started, we’ve selected a few https 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 itachiRedhair / alexa-skill-local / endpointController.js View on Github external
return new Promise((resolve, reject) => {
        const req = https.request(options, function (res) {
            res.setEncoding('utf8');
            res.on('data', function (body) {
                resolve({ statusCode: res.statusCode })
            });
        });
        req.on('error', function (e) {
            // throw new Error(`Error updating Alexa Skill Endpoint`);
            reject(e);
        });
        // write data to request body
        req.write(JSON.stringify(body));
        req.end();
    })
}
github DanielSchaffer / webpack-babel-multi-target-plugin / examples / _util / browserstack-reporter.ts View on Github external
return new Promise((resolve, reject) => {
      const req = request(options, (res) => {
        res.on('error', reject)
        res.on('data', (buf) => console.log('marked', res.statusCode, buf.toString()))
        res.on('end', resolve)
      })

      req.on('error', err => reject(err))
      console.log('marking', data)
      req.write(data)
      req.end()
    })
  }
github DanielSchaffer / webpack-babel-multi-target-plugin / examples / angular / protractor.conf.js View on Github external
return new Promise((resolve, reject) => {
      const req = https.request(options, (res) => {
        res.on('error', reject)
        res.on('data', (buf) => console.log('marked', res.statusCode, buf.toString()))
        res.on('end', resolve)
      })

      req.on('error', err => reject(err))
      console.log('marking', data)
      req.write(data)
      req.end()
    })
  }
github sealtalk / sealtalk-server / src / util / admin-report.js View on Github external
return new Promise((resolve, reject) => {
    var content = options.content;

    var req = https.request(options, function (res) {
      res.setEncoding('utf8');
      res.on('data', function (chunk) {
        resolve(chunk);
      });
    });
    req.on('error', function (e) {
      reject(e);
    });

    req.write(content);
    req.end();
  });
};
github cesanta / mongoose-os / fw / examples / helpers / cloudformation-helpers / aws / cognito.js View on Github external
return new Promise((resolve, reject) => {
      const request = https
        .request(options, resolve);

      request.on('error', error => reject(`send(..) failed executing https.request(..): ${error}`));
      request.write(responseBody);
      request.end();
    })
    .then(() => callback(responseStatus === FAILED ? responseStatus : null, responseData))

https

https mediation

ISC
Latest version published 10 years ago

Package Health Score

59 / 100
Full package analysis