* Makes a request to a secure web server. * @param {...any} args * @returns {ClientRequest}
(...args)
| 610 | * @returns {ClientRequest} |
| 611 | */ |
| 612 | function 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. |
no test coverage detected
searching dependent graphs…