Options
All
  • Public
  • Public/Protected
  • All
Menu

Class HTTPService

Hierarchy

  • HTTPService

Index

Properties

_cache

_cache: Cache

_cahceDuration

_cahceDuration: number

_http

_http: AxiosInstance

_requestMiddleware

_requestMiddleware: RequestMiddleware[]

_responseErrorMiddleware

_responseErrorMiddleware: ResponseErrorMiddleware[]

_responseMiddleware

_responseMiddleware: ResponseMiddleware[]

_storageService

_storageService: StorageService

Accessors

cacheDuration

  • get cacheDuration(): number
  • set cacheDuration(value: number): any

Methods

delete

  • delete(endpoint: string): Promise<AxiosResponse>
  • send a delete request to the given endpoint

    Parameters

    • endpoint: string

      the endpoint for the get

    Returns Promise<AxiosResponse>

download

  • download(endpoint: string, documentName: string, type?: string): Promise<AxiosResponse>
  • download a file from the backend type should be resolved automagically, if not, then you can pass the type

    Parameters

    • endpoint: string

      the endpoint for the download

    • documentName: string

      the name of the document to be downloaded

    • Optional type: string

    Returns Promise<AxiosResponse>

get

  • get(endpoint: string, options?: AxiosRequestConfig): Promise<AxiosResponse>
  • send a get request to the given endpoint

    Parameters

    • endpoint: string

      the endpoint for the get

    • Optional options: AxiosRequestConfig

    Returns Promise<AxiosResponse>

post

  • post(endpoint: string, data: any): Promise<AxiosResponse>
  • send a post request to the given endpoint with the given data

    Parameters

    • endpoint: string

      the endpoint for the post

    • data: any

      the data to be send to the server

    Returns Promise<AxiosResponse>

registerRequestMiddleware

  • registerRequestMiddleware(middlewareFunc: any): void

registerResponseErrorMiddleware

  • registerResponseErrorMiddleware(middlewareFunc: any): void

registerResponseMiddleware

  • registerResponseMiddleware(middlewareFunc: any): void

Generated using TypeDoc