Options
All
  • Public
  • Public/Protected
  • All
Menu

Class AbstractHTTP

Abstract implementation of the OnmsHTTP interface meant to be extended by a concrete class.

implements

IOnmsHTTP

Hierarchy

Implements

Index

Constructors

constructor

  • Create a new HTTP instance.

    constructor

    Parameters

    • Optional server: OnmsServer

      A server object for immediate configuration.

    • Default value timeout: number = 10000

      How long to wait until timing out requests.

    Returns AbstractHTTP

Properties

options

The default set of HTTP options associated with this ReST client.

timeout

timeout: number = 10000

The default amount of time to wait before giving up on a request.

Accessors

server

  • The server associated with this HTTP implementation.

    Returns OnmsServer

  • The server associated with this HTTP implementation.

    Parameters

    Returns void

Methods

get

  • Make an HTTP GET call. This must be implemented by the concrete implementation.

    Parameters

    Returns Promise<OnmsResult<any>>

Protected getOptions

  • Get the union of OnmsHTTPOptions based on the passed options, defaults, and options in the OnmsServer associated with this request. Order of precedence is passed options -> server options -> default options.

    Parameters

    Returns OnmsHTTPOptions

Protected getServer

  • Get the OnmsServer object that should be used for making requests. Favors the one passed in the OnmsHTTPOptions, otherwise it falls back to the default server associated with the HTTP implementation.

    Parameters

    Returns OnmsServer

Protected onSetServer

  • onSetServer(): void
  • Implementers should override this method if they have actions that need to be performed (like clearing a cache) when server settings change.

    Returns void

put

  • Make an HTTP PUT call. This must be overridden by the concrete implementation.

    Parameters

    Returns Promise<OnmsResult<any>>

Protected transformJSON

  • transformJSON(data: any): any
  • A convenience method for implementers to use to turn JSON into a javascript object. Use this to process a JSON response before returning it in an OnmsResult object.

    Parameters

    • data: any

    Returns any

Protected transformXML

  • transformXML(data: any): any
  • A convenience method for implementers to use to turn XML into a javascript object. Use this to process an XML response before returning it in an OnmsResult object.

    Parameters

    • data: any

    Returns any

Generated using TypeDoc