mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-02-25 18:22:55 +00:00
[node] add setHost to http.ClientRequestArgs
This commit is contained in:
parent
6def4dbaaa
commit
73df157ff4
1
types/node/index.d.ts
vendored
1
types/node/index.d.ts
vendored
@ -1194,6 +1194,7 @@ declare module "http" {
|
||||
agent?: Agent | boolean;
|
||||
_defaultAgent?: Agent;
|
||||
timeout?: number;
|
||||
setHost?: boolean;
|
||||
// https://github.com/nodejs/node/blob/master/lib/_http_client.js#L278
|
||||
createConnection?: (options: ClientRequestArgs, oncreate: (err: Error, socket: net.Socket) => void) => net.Socket;
|
||||
}
|
||||
|
||||
@ -1940,6 +1940,7 @@ async function asyncStreamPipelineFinished() {
|
||||
let req: http.ClientRequest = new http.ClientRequest("https://www.google.com");
|
||||
req = new http.ClientRequest(new url.URL("https://www.google.com"));
|
||||
req = new http.ClientRequest({ path: 'http://0.0.0.0' });
|
||||
req = new http.ClientRequest({ setHost: false });
|
||||
|
||||
// header
|
||||
req.setHeader('Content-Type', 'text/plain');
|
||||
|
||||
Loading…
Reference in New Issue
Block a user