GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — typings: add JSDoc typings for http · nodejs/node@60c7591

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • lib
    • http.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎lib/http.js‎

Copy file name to clipboardExpand all lines: lib/http.js
+51Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,65 @@ const {
4242
} = require('_http_server');
4343
let maxHeaderSize;
4444

45+
/**
46+
* Returns a new instance of `http.Server`.
47+
* @param {{
48+
* IncomingMessage?: IncomingMessage;
49+
* ServerResponse?: ServerResponse;
50+
* insecureHTTPParser?: boolean;
51+
* maxHeaderSize?: number;
52+
* }} [opts]
53+
* @param {Function} [requestListener]
54+
* @returns {Server}
55+
*/
4556
function createServer(opts, requestListener) {
4657
return new Server(opts, requestListener);
4758
}
4859

60+
/**
61+
* @typedef {Object} HTTPRequestOptions
62+
* @property {httpAgent.Agent | boolean} [agent]
63+
* @property {string} [auth]
64+
* @property {Function} [createConnection]
65+
* @property {number} [defaultPort]
66+
* @property {number} [family]
67+
* @property {Object} [headers]
68+
* @property {number} [hints]
69+
* @property {string} [host]
70+
* @property {string} [hostname]
71+
* @property {boolean} [insecureHTTPParser]
72+
* @property {string} [localAddress]
73+
* @property {number} [localPort]
74+
* @property {Function} [lookup]
75+
* @property {number} [maxHeaderSize]
76+
* @property {string} [method]
77+
* @property {string} [path]
78+
* @property {number} [port]
79+
* @property {string} [protocol]
80+
* @property {boolean} [setHost]
81+
* @property {string} [socketPath]
82+
* @property {number} [timeout]
83+
* @property {AbortSignal} [signal]
84+
*/
85+
86+
/**
87+
* Makes an HTTP request.
88+
* @param {string | URL} url
89+
* @param {HTTPRequestOptions} [options]
90+
* @param {Function} [cb]
91+
* @returns {ClientRequest}
92+
*/
4993
function request(url, options, cb) {
5094
return new ClientRequest(url, options, cb);
5195
}
5296

97+
/**
98+
* Makes a `GET` HTTP request.
99+
* @param {string | URL} url
100+
* @param {HTTPRequestOptions} [options]
101+
* @param {Function} [cb]
102+
* @returns {ClientRequest}
103+
*/
53104
function get(url, options, cb) {
54105
const req = request(url, options, cb);
55106
req.end();

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.