https.request()

https.request(options, callback) Makes a request to a secure web server. options can be an object or a string. If options is a string, it is automatically parsed with url.parse(). All options from http.request() are valid. Example: const https = require('https'); var options = { hostname: 'encrypted.google.com', port: 443, path: '/', method: 'GET' }; var req = https.request(options, (res) => { console.log('statusCode: ', res.statusCode); console.log('headers: ', res.headers

https.globalAgent

https.globalAgent Global instance of https.Agent for all HTTPS client requests.

https.get()

https.get(options, callback) Like http.get() but for HTTPS. options can be an object or a string. If options is a string, it is automatically parsed with url.parse(). Example: const https = require('https'); https.get('https://encrypted.google.com/', (res) => { console.log('statusCode: ', res.statusCode); console.log('headers: ', res.headers); res.on('data', (d) => { process.stdout.write(d); }); }).on('error', (e) => { console.error(e); });

https.createServer()

https.createServer(options[, requestListener]) Returns a new HTTPS web server object. The options is similar to tls.createServer(). The requestListener is a function which is automatically added to the 'request' event. Example: // curl -k https://localhost:8000/ const https = require('https'); const fs = require('fs'); const options = { key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'), cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem') }; https.createServer(options, (r

https.Agent

Class: https.Agent An Agent object for HTTPS similar to http.Agent. See https.request() for more information.

http.STATUS_CODES

http.STATUS_CODES <Object> A collection of all the standard HTTP response status codes, and the short description of each. For example, http.STATUS_CODES[404] === 'Not Found'.

http.ServerResponse

Class: http.ServerResponse This object is created internally by a HTTP server--not by the user. It is passed as the second parameter to the 'request' event. The response implements the Writable Stream interface. This is an EventEmitter with the following events:

http.Server

Class: http.Server This class inherits from net.Server and has the following additional events:

http.request()

http.request(options[, callback]) Node.js maintains several connections per server to make HTTP requests. This function allows one to transparently issue requests. options can be an object or a string. If options is a string, it is automatically parsed with url.parse(). Options: protocol: Protocol to use. Defaults to 'http:'. host: A domain name or IP address of the server to issue the request to. Defaults to 'localhost'. hostname: Alias for host. To support url.parse() hostname is prefer

http.METHODS

http.METHODS <Array> A list of the HTTP methods that are supported by the parser.