mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-07-04 17:20:09 +00:00
[node] ensure compatiblity between http.request and url.parse (#40430)
* [node] ensure compatiblity between http.request and url.parse Ensure that output of url.parse() fits into http.request() as indicated at https://nodejs.org/dist/latest-v12.x/docs/api/http.html#http_http_request_url_options_callback * fix typo Co-Authored-By: Trivikram Kamat <16024985+trivikr@users.noreply.github.com>
This commit is contained in:
committed by
Sheetal Nandi
parent
56faec0579
commit
8fa67cd896
12
types/node/http.d.ts
vendored
12
types/node/http.d.ts
vendored
@@ -69,18 +69,18 @@ declare module "http" {
|
||||
}
|
||||
|
||||
interface ClientRequestArgs {
|
||||
protocol?: string;
|
||||
host?: string;
|
||||
hostname?: string;
|
||||
protocol?: string | null;
|
||||
host?: string | null;
|
||||
hostname?: string | null;
|
||||
family?: number;
|
||||
port?: number | string;
|
||||
port?: number | string | null;
|
||||
defaultPort?: number | string;
|
||||
localAddress?: string;
|
||||
socketPath?: string;
|
||||
method?: string;
|
||||
path?: string;
|
||||
path?: string | null;
|
||||
headers?: OutgoingHttpHeaders;
|
||||
auth?: string;
|
||||
auth?: string | null;
|
||||
agent?: Agent | boolean;
|
||||
_defaultAgent?: Agent;
|
||||
timeout?: number;
|
||||
|
||||
@@ -139,6 +139,8 @@ import * as net from 'net';
|
||||
http.request({ agent: false });
|
||||
http.request({ agent });
|
||||
http.request({ agent: undefined });
|
||||
// ensure compatibility with url.parse()
|
||||
http.request(url.parse("http://www.example.org/xyz"));
|
||||
}
|
||||
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user