mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 20:40:20 +00:00
Allow option to be a string in Node 6 request methods (#20272)
* Add string option to request methods. Per [Node docs](https://nodejs.org/docs/latest-v6.x/api/http.html#http_http_request_options_callback) the `get` and `request` methods should allow the `options` param to be a string. This is true for both the 'https' and 'http' modules. * Add self to "definitions by" per README recommendations
This commit is contained in:
Vendored
+4
-4
@@ -1,6 +1,6 @@
|
||||
// Type definitions for Node.js v6.x
|
||||
// Project: http://nodejs.org/
|
||||
// Definitions by: Microsoft TypeScript <http://typescriptlang.org>, DefinitelyTyped <https://github.com/DefinitelyTyped/DefinitelyTyped>, Wilco Bakker <https://github.com/WilcoBakker>
|
||||
// Definitions by: Microsoft TypeScript <http://typescriptlang.org>, DefinitelyTyped <https://github.com/DefinitelyTyped/DefinitelyTyped>, Wilco Bakker <https://github.com/WilcoBakker>, Thomas Bouldin <https://github.com/inlined>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/************************************************
|
||||
@@ -798,7 +798,7 @@ declare module "http" {
|
||||
};
|
||||
export function createServer(requestListener?: (request: IncomingMessage, response: ServerResponse) => void): Server;
|
||||
export function createClient(port?: number, host?: string): any;
|
||||
export function request(options: RequestOptions, callback?: (res: IncomingMessage) => void): ClientRequest;
|
||||
export function request(options: RequestOptions | string, callback?: (res: IncomingMessage) => void): ClientRequest;
|
||||
export function get(options: any, callback?: (res: IncomingMessage) => void): ClientRequest;
|
||||
export var globalAgent: Agent;
|
||||
}
|
||||
@@ -1353,8 +1353,8 @@ declare module "https" {
|
||||
};
|
||||
export interface Server extends tls.Server { }
|
||||
export function createServer(options: ServerOptions, requestListener?: Function): Server;
|
||||
export function request(options: RequestOptions, callback?: (res: http.IncomingMessage) => void): http.ClientRequest;
|
||||
export function get(options: RequestOptions, callback?: (res: http.IncomingMessage) => void): http.ClientRequest;
|
||||
export function request(options: RequestOptions | string, callback?: (res: http.IncomingMessage) => void): http.ClientRequest;
|
||||
export function get(options: RequestOptions | string, callback?: (res: http.IncomingMessage) => void): http.ClientRequest;
|
||||
export var globalAgent: Agent;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user