diff --git a/node/node-tests.ts b/node/node-tests.ts index 51edd42a7..c36f0da1e 100644 --- a/node/node-tests.ts +++ b/node/node-tests.ts @@ -100,3 +100,13 @@ var request = http.request('http://0.0.0.0'); request.once('error', function () {}); request.setNoDelay(true); request.abort(); + +//////////////////////////////////////////////////// +/// Http tests : http://nodejs.org/api/http.html +//////////////////////////////////////////////////// +module http_tests { + // Status codes + var code = 100; + var codeMessage = http.STATUS_CODES['400']; + var codeMessage = http.STATUS_CODES[400]; +} \ No newline at end of file diff --git a/node/node.d.ts b/node/node.d.ts index 2bd63497d..5f169c8c8 100644 --- a/node/node.d.ts +++ b/node/node.d.ts @@ -348,7 +348,10 @@ declare module "http" { } export interface Agent { maxSockets: number; sockets: any; requests: any; } - export var STATUS_CODES: any; + export var STATUS_CODES: { + [errorCode: number]: string; + [errorCode: string]: string; + }; export function createServer(requestListener?: (request: ServerRequest, response: ServerResponse) =>void ): Server; export function createClient(port?: number, host?: string): any; export function request(options: any, callback?: Function): ClientRequest;