Merge pull request #13555 from sqren/patch-1

Request: Add RequestOptions to Response object
This commit is contained in:
Horiuchi_H
2016-12-27 14:55:23 +09:00
committed by GitHub
+6 -2
View File
@@ -75,7 +75,7 @@ declare namespace request {
interface CoreOptions {
baseUrl?: string;
callback?: (error: any, response: http.IncomingMessage, body: any) => void;
callback?: (error: any, response: RequestResponse, body: any) => void;
jar?: any; // CookieJar
formData?: any; // Object
form?: any; // Object or string
@@ -134,9 +134,13 @@ declare namespace request {
export type Options = OptionsWithUri | OptionsWithUrl;
export interface RequestCallback {
(error: any, response: http.IncomingMessage, body: any): void;
(error: any, response: RequestResponse, body: any): void;
}
export interface RequestResponse extends http.IncomingMessage {
request: Options;
}
export interface HttpArchiveRequest {
url?: string;
method?: string;