Skip to content
Pavel Koch edited this page Mar 2, 2019 · 7 revisions

Interface Client

import { Client } from 'awi'

use (interceptor: Interceptor, priority?: number) : Client

Provides a way to intercept any request directly. The callback takes in an instance of Request and alters its contents. The return value is disregarded.

Parameters

  • interceptor: Interceptor - The function that alters the event
  • priority?: number - The priority of the interceptor, interceptors with higher priority are executed first

Returns

Client - The instance for chaining


send<T extends Response> () : Promise<T>

Perform the transformed request.

Type Parameters

  • T extends Response - The desired response type

Returns

Promise<T> - The desired response

Throws

  • HttpException - If somethig goes wrong when executing the request

Clone this wiki locally