From f2f72772620e10138bbb380fc1edb73001db0bf7 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Thu, 13 Aug 2015 12:25:57 -0700 Subject: [PATCH] 'compressed' in 'needle' --- needle/needle-tests.ts | 2 +- needle/needle.d.ts | 19 +++++++++++++++---- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/needle/needle-tests.ts b/needle/needle-tests.ts index 24d9701b5..106d46a71 100644 --- a/needle/needle-tests.ts +++ b/needle/needle-tests.ts @@ -22,7 +22,7 @@ function ResponsePipeline() { var options = { compressed: true, - follow: true, + follow: 5, rejectUnauthorized: true }; diff --git a/needle/needle.d.ts b/needle/needle.d.ts index 741cf5fe3..e7a67387d 100644 --- a/needle/needle.d.ts +++ b/needle/needle.d.ts @@ -15,13 +15,21 @@ declare module Needle { interface RequestOptions { timeout?: number; - follow?: any; // number | string + follow?: number; + follow_max?: number; multipart?: boolean; proxy?: string; agent?: string; - headers?: any; + headers?: HttpHeaderOptions; auth?: string; // auto | digest | basic (default) json?: boolean; + + // These properties are overwritten by those in the 'headers' field + compressed?: boolean; + cookies?: { [name: string]: any; }; + // Overwritten if present in the URI + username?: string; + password?: string; } interface ResponseOptions { @@ -31,12 +39,15 @@ declare module Needle { } interface HttpHeaderOptions { + cookies?: { [name: string]: any; }; compressed?: boolean; - username?: string; - password?: string; accept?: string; connection?: string; user_agent?: string; + + // Overwritten if present in the URI + username?: string; + password?: string; } interface TLSOptions {