MCPcopy Index your code
hub / github.com/nodejs/node / request

Function request

lib/https.js:612–630  ·  view source on GitHub ↗

* Makes a request to a secure web server. * @param {...any} args * @returns {ClientRequest}

(...args)

Source from the content-addressed store, hash-verified

610 * @returns {ClientRequest}
611 */
612function request(...args) {
613 let options = {};
614
615 if (typeof args[0] === 'string') {
616 const urlStr = ArrayPrototypeShift(args);
617 options = urlToHttpOptions(new URL(urlStr));
618 } else if (isURL(args[0])) {
619 options = urlToHttpOptions(ArrayPrototypeShift(args));
620 }
621
622 if (args[0] && typeof args[0] !== 'function') {
623 ObjectAssign(options, ArrayPrototypeShift(args));
624 }
625
626 options._defaultAgent = module.exports.globalAgent;
627 ArrayPrototypeUnshift(args, options);
628
629 return ReflectConstruct(ClientRequest, args);
630}
631
632/**
633 * Makes a GET request to a secure web server.

Callers 1

getFunction · 0.70

Calls 3

urlToHttpOptionsFunction · 0.85
ObjectAssignFunction · 0.85
isURLFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…