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:
Thomas Bouldin
2017-10-06 07:21:37 -07:00
committed by Andy
parent 262601f878
commit 234e726219
+4 -4
View File
@@ -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;
}