mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-18 22:01:42 +08:00
http refactored to fix circular references
This commit is contained in:
31
net/http_request.d.ts
vendored
Normal file
31
net/http_request.d.ts
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
/**
|
||||
* 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?: HttpHeader[];
|
||||
content?: HttpContent;
|
||||
}
|
||||
|
||||
export interface HttpHeader {
|
||||
name: string;
|
||||
value: string;
|
||||
}
|
||||
|
||||
export interface HttpResponse {
|
||||
statusCode: number;
|
||||
headers: HttpHeader[];
|
||||
content?: HttpContent;
|
||||
}
|
||||
|
||||
export interface HttpContent {
|
||||
toString: () => string;
|
||||
toJSON: () => any;
|
||||
toImage: () => image_module.Image;
|
||||
}
|
Reference in New Issue
Block a user