httpClient
HttpClient
Thin wrapper around axios that centralizes:
- Host resolution via
getHost(name). - The backend
{ successfully: true }contract. - Centralized error logging.
Success contract:
{ successfully: true, ... }→ resolves withresponse.datatyped asApiSuccess<TResponse>.{ successfully: !true, ... }with atypein the body → throws ProblemDetailsError.{ successfully: !true, ... }without atype→ throws ApiError.- Thrown axios/network error → logged and re-thrown.
- Binary responses (
responseType: 'blob' | 'arraybuffer') bypass thesuccessfullycheck and return raw data.
httpClient.blob()
Low-level download. Returns the raw axios data (typically a Blob).
Kind: instance method of HttpClient