Adding basic authentication support

Added property "auth" to options class and method "request.auth" to provide basic authentication
This commit is contained in:
LeandroDG
2015-05-28 13:25:04 -03:00
parent 70737c2a24
commit 9920fd383c

View File

@@ -62,6 +62,7 @@ declare module 'request' {
callback?: (error: any, response: any, body: any) => void;
jar?: any; // CookieJar
form?: any; // Object or string
auth?: AuthOptions;
oauth?: OAuthOptions;
aws?: AWSOptions;
hawk ?: HawkOptions;
@@ -107,6 +108,7 @@ declare module 'request' {
multipart(multipart: RequestPart[]): Request;
json(val: any): Request;
aws(opts: AWSOptions, now?: boolean): Request;
auth(username: string, password: string, sendInmediately?: boolean, bearer?: string): Request;
oauth(oauth: OAuthOptions): Request;
jar(jar: CookieJar): Request;