Options
All
  • Public
  • Public/Protected
  • All
Menu

Class AxiosHTTP

Implementation of the IOnmsHTTP interface using Axios: https://github.com/mzabriskie/axios

implements

IOnmsHTTP

Hierarchy

Implements

Index

Constructors

constructor

  • Construct an AxiosHTTP instance.

    Parameters

    • Optional server: OnmsServer

      The server to connect to.

    • Optional axiosImpl: AxiosStatic

      The Axios implementation class to use.

    • Default value timeout: number = 10000

      The default timeout for ReST connections.

    Returns AxiosHTTP

Properties

Private Optional axiosObj

axiosObj: AxiosInstance

The Axios instance we'll use for making ReST calls. This will be reinitialized whenever the server configuration changes.

isValid

isValid: boolean = false

Whether this plugin is valid and can be initialized.

Implementations can use this to signal whether any optional dependencies or other conditions have been met for the plugin to work.

Accessors

options

server

timeout

  • get timeout(): number
  • set timeout(t: number): void

Methods

get

Protected getData

  • getData(response: any): any

Protected getOptions

Protected getServer

head

httpDelete

Protected onBasicAuth

  • onBasicAuth(username: string, password: string, newHash: string, oldHash?: string): void

Protected onSetServer

  • onSetServer(): void

post

put

Protected transformJSON

  • transformJSON(data: any): any

Protected transformXML

  • transformXML(data: any): any

Protected useBasicAuth

  • useBasicAuth(username?: string, password?: string): void
  • Set or update the basic auth credentials to be used in making connections.

    Parameters

    • Optional username: string

      The username to connect with

    • Optional password: string

      The password to connect with

    Returns void

Static isValid

  • isValid(): boolean

Generated using TypeDoc