mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 20:11:24 +08:00
readme updated again
This commit is contained in:
@ -1,28 +1,3 @@
|
|||||||
Sample code:
|
Definition: https://github.com/telerik/xPlatCore/blob/master/JS/BCL/http/http.d.ts
|
||||||
```js
|
|
||||||
var http = require("http");
|
|
||||||
|
|
||||||
// Universal request method. You can use HttpRequestOptions to set varios properties like url, headers, etc.,
|
Sample code: https://github.com/telerik/xPlatCore/blob/master/Documentation/Snippets/http.md
|
||||||
// HttpResponse to get status code, headers and content and HttpContent to get body of response:
|
|
||||||
|
|
||||||
interface HttpRequestOptions {
|
|
||||||
url: string;
|
|
||||||
method: string;
|
|
||||||
headers?: any;
|
|
||||||
content?: HttpContent;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface HttpResponse {
|
|
||||||
statusCode: number;
|
|
||||||
headers: any;
|
|
||||||
content?: HttpContent;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface HttpContent {
|
|
||||||
toString: () => string;
|
|
||||||
toJSON: () => any;
|
|
||||||
toImage: () => image_module.Image;
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
More info: https://github.com/telerik/xPlatCore/blob/master/Documentation/Snippets/http.md
|
|
Reference in New Issue
Block a user