// To import the "http" module:
var http = require("http");
How to "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
- getString( options HttpRequestOptions ) Promise...
Downloads the content from the specified URL as a string.
- 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
- getJSON( options HttpRequestOptions ) Promise...
Types Parameters: T
Downloads the content from the specified URL as a string and returns its JSON.parse representation.
- getImage( url String ) Promise...
Downloads the content from the specified URL and attempts to decode it as an image.
- getImage( options HttpRequestOptions ) Promise...
Downloads the content from the specified URL and attempts to decode it as an image.
- request( options HttpRequestOptions ) Promise...
Makes a generic http request using the provided options and returns a HttpResponse Object.