Skip to content

HTTP ​

The HTTP namespace provides helpers for creating HTTP requests and handling their response state.


Interfaces ​

HTTPRequestInfo ​

The HTTPRequestInfo interface describes the corresponding object shape exposed by the declarations.

  • headers{ [key: string]: string; } (optional) - The headers.
  • parameters{ [key: string]: string; } (optional) - The parameters.
  • datastring (optional) - Used in POST
  • sslboolean (optional) - Default: false
  • portnumber (optional) - Default: 80 or 443 (if ssl is true)
  • readTimeoutnumber (optional) - Default: 30, in seconds
  • writeTimeoutnumber (optional) - Default: 30, in seconds

Functions ​

Request(url: string, path: string, method: string, optInfo?: HTTPRequestInfo)HTTPConnection ​

Performs an HTTP request using the specified URL, path, and request options.

  • urlstring - The base URL of the request.
  • pathstring - The request path.
  • methodstring - The HTTP method to use.
  • optInfoHTTPRequestInfo (optional) - The HTTP request options.

Returned: