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

Methods

get

Protected getData

  • getData(response: any): any
  • Attempt to extract the data from a response.

    Parameters

    • response: any

    Returns any

Protected getOptions

Protected getServer

httpDelete

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

post

put

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