Constructors
constructor
- new DefaultHttpClient(authUrl: string, apiUrl: string, fetch: Fetch): DefaultHttpClient
-
Parameters
-
authUrl: string
-
apiUrl: string
-
fetch: Fetch
Properties
Protected apiUrl
apiUrl: string
Protected authUrl
authUrl: string
Protected fetch
fetch: Fetch
Methods
apiRequest
- apiRequest<T>(apiToken: string | undefined, path: string, method: string, params?: HttpQueryParameters, body?: any, headers?: HttpHeaders): Promise<T>
-
Type parameters
Parameters
-
apiToken: string | undefined
-
path: string
-
method: string
-
-
Optional body: any
-
Returns Promise<T>
authRequest
-
Type parameters
Parameters
-
path: string
-
method: string
-
-
Optional body: any
-
Returns Promise<T>
The
DefaultHttpClient
is responsible of performing the actual HTTP calls transforming the parameters into an actual HTTP request and turning back the HTTP response into a return value.All methods are asynchronous and returns a response object when successufl and throws a
DfuseError
when an error is encountered.