Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Http

An Http object is an adapter that performs HTTP requests using the underlying request library.

Hierarchy

  • Http

Index

Constructors

Methods

Constructors

constructor

  • new Http(baseUrl: string, headers?: any): Http
  • Initializes an instance with the baseUrl and header configuration. The baseUrl value will be prepended to all relative urls made with this instance, whereas absolute urls will be passed through without prefixing.

    Parameters

    • baseUrl: string
    • Optional headers: any

    Returns Http

Methods

cancel

  • cancel(): void
  • Returns void

get

  • get(url: string, opts?: any): Promise<AxiosResponse<any>>
  • Performs a GET request for the relative or absolute url.

    memberof

    Http

    Parameters

    • url: string
    • Default value opts: any = undefined

    Returns Promise<AxiosResponse<any>>

post

  • post(url: string, data: any, opts?: any): Promise<AxiosResponse<any>>
  • Performs a POST request for the relative or absolute url.

    memberof

    Http

    Parameters

    • url: string
    • data: any
    • Default value opts: any = undefined

    Returns Promise<AxiosResponse<any>>

Static request

  • request(url: string, opts?: any): Promise<AxiosResponse<any>>
  • A class method that performs a request to an absolute url.

    Parameters

    • url: string
    • Default value opts: any = undefined

    Returns Promise<AxiosResponse<any>>

Generated using TypeDoc