Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • HttpClient

Index

Constructors

constructor

  • new HttpClient(tokenProvider: TokenProvider, config?: Partial<{ apiUrl: string; httpClientConfig: Options; storageUrl: string }>): HttpClient
  • Parameters

    • tokenProvider: TokenProvider
    • Optional config: Partial<{ apiUrl: string; httpClientConfig: Options; storageUrl: string }>

    Returns HttpClient

Properties

Private Readonly apiKy

apiKy: KyInstance

Readonly apiUrl

apiUrl: string

Readonly storageUrl

storageUrl: string

Methods

create

  • create<T>(endpoint: string, data: undefined | FormData | Record<string, JsonSerializable>, requestOptions?: Options): Promise<T>
  • Convenience method for POSTing and expecting a 201 response

    Type parameters

    • T

    Parameters

    • endpoint: string
    • data: undefined | FormData | Record<string, JsonSerializable>
    • Optional requestOptions: Options

    Returns Promise<T>

delete

  • delete(endpoint: string): Promise<void>
  • Parameters

    • endpoint: string

    Returns Promise<void>

download

get

  • get<T>(endpoint: string, params?: Record<string, undefined | string | number | boolean | Date>, requestOptions?: Options): Promise<T>
  • Type parameters

    • T

    Parameters

    • endpoint: string
    • params: Record<string, undefined | string | number | boolean | Date> = {}
    • Optional requestOptions: Options

    Returns Promise<T>

post

  • post<T>(endpoint: string, data: undefined | FormData | Record<string, JsonSerializable>, requestOptions?: Options): Promise<T>
  • Type parameters

    • T

    Parameters

    • endpoint: string
    • data: undefined | FormData | Record<string, JsonSerializable>
    • Optional requestOptions: Options

    Returns Promise<T>

put

  • put<T>(endpoint: string, params: Record<string, JsonSerializable>): Promise<T>
  • Type parameters

    • T

    Parameters

    Returns Promise<T>

search

  • search<T>(baseEndpoint: string, params: undefined | Record<string, JsonSerializable>, requestOptions?: Options): Promise<Page<T>>
  • Convenience method for POSTing and expecting a 200 response

    Type parameters

    • T

    Parameters

    • baseEndpoint: string
    • params: undefined | Record<string, JsonSerializable>
    • Optional requestOptions: Options

    Returns Promise<Page<T>>

update

  • update<T>(endpoint: string, params: Record<string, JsonSerializable>): Promise<T>
  • Type parameters

    • T

    Parameters

    Returns Promise<T>

upload

  • upload(data: FormData, requestOptions?: Options): Promise<Readonly<PODModel & { creator: string; details: DocumentDetails; originatingJob?: JobId; owner: string; size: number }>>
  • Parameters

    • data: FormData
    • Optional requestOptions: Options

    Returns Promise<Readonly<PODModel & { creator: string; details: DocumentDetails; originatingJob?: JobId; owner: string; size: number }>>

Generated using TypeDoc