// To import the "http" module:
var http = require("http");
Object | Description |
---|---|
HttpRequestOptions | Provides options for the http requests. |
HttpResponse | Encapsulates HTTP-response information from an HTTP-request. |
HttpContent | Encapsulates the content of an HttpResponse. |
- getString( url String ) Promise...
Downloads the content from the specified URL as a string.- url - String
The URL to request from. - return - Promise of String
- url - String
- getString( options HttpRequestOptions ) Promise...
Downloads the content from the specified URL as a string.- options - HttpRequestOptions
An object that specifies various request options. - return - Promise of String
- options - HttpRequestOptions
- getJSON( url String ) Promise...
Types Parameters: T
Downloads the content from the specified URL as a string and returns its JSON.parse representation.- url - String
The URL to request from. - return - Promise of T
- url - String
- getJSON( options HttpRequestOptions ) Promise...
Types Parameters: T
Downloads the content from the specified URL as a string and returns its JSON.parse representation.- options - HttpRequestOptions
An object that specifies various request options. - return - Promise of T
- options - HttpRequestOptions
- getImage( url String ) Promise...
Downloads the content from the specified URL and attempts to decode it as an image.- url - String
The URL to request from. - return - Promise of ImageSource
- url - String
- getImage( options HttpRequestOptions ) Promise...
Downloads the content from the specified URL and attempts to decode it as an image.- options - HttpRequestOptions
An object that specifies various request options. - return - Promise of ImageSource
- options - HttpRequestOptions
- request( options HttpRequestOptions ) Promise...
Makes a generic http request using the provided options and returns a HttpResponse Object.- options - HttpRequestOptions
An object that specifies various request options. - return - Promise of HttpResponse
- options - HttpRequestOptions