http module refactored

This commit is contained in:
Vladimir Enchev
2014-05-16 10:18:25 +03:00
parent 4faced08aa
commit 2b47aebbe8
7 changed files with 22 additions and 48 deletions

View File

@ -1,28 +0,0 @@
/**
* The http client interface.
*/
import image_module = require("image-source/image-source");
import promises = require("promises/promises");
export declare function request(options: HttpRequestOptions): promises.Promise<HttpResponse>;
export interface HttpRequestOptions {
url: string;
method: string;
headers?: any;
content?: any;
timeout?: number;
}
export interface HttpResponse {
statusCode: number;
headers: any;
content?: HttpContent;
}
export interface HttpContent {
raw: any;
toString: () => string;
toJSON: () => any;
toImage: () => image_module.ImageSource;
}