mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 11:42:04 +08:00
28 lines
611 B
TypeScript
28 lines
611 B
TypeScript
/**
|
|
* The http client interface.
|
|
*/
|
|
import image_module = require("image/image");
|
|
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.Image;
|
|
} |