UNPKG

@opra/client

Version:

Opra Client package

26 lines (25 loc) 732 B
import { kBackend } from './constants.js'; import { FetchBackend } from './fetch-backend.js'; import { HttpClientBase } from './http-client-base.js'; /** * Default implementation of {@link HttpClientBase} using {@link FetchBackend}. * * @class OpraHttpClient */ export class OpraHttpClient extends HttpClientBase { /** * Creates a new instance of OpraHttpClient. * * @param serviceUrl The base URL of the service. * @param options Configuration options. */ constructor(serviceUrl, options) { super(new FetchBackend(serviceUrl, options)); } /** * Gets the default request options from the backend. */ get defaults() { return this[kBackend].defaults; } }