UNPKG

fhir-kit-client

Version:
35 lines 1.67 kB
import type { FhirResource, RequestOptions } from './types.js'; /** * Internal HTTP client. Use Client methods instead of this class directly. */ export declare class HttpClient { private baseUrlValue; customHeaders: Record<string, string>; private readonly baseRequestOptions; private readonly requestSigner?; private authHeader; /** Keepalive agents keyed by base URL, reused across requests on this instance. */ private readonly agentCache; constructor({ baseUrl, customHeaders, requestOptions, requestSigner, }: { baseUrl: string; customHeaders?: Record<string, string>; requestOptions?: Record<string, unknown>; requestSigner?: (url: string, options: RequestInit) => void; }); set baseUrl(url: string); get baseUrl(): string; set bearerToken(token: string); static responseFor(requestResponse: FhirResource): Response | undefined; static requestFor(requestResponse: FhirResource): Request | undefined; private mergeHeaders; private buildAgent; expandUrl(url?: string): string; private buildRequest; request(method: string, requestUrl: string, options?: RequestOptions, body?: unknown): Promise<FhirResource>; get(url: string, options?: RequestOptions): Promise<FhirResource>; delete(url: string, options?: RequestOptions): Promise<FhirResource>; put(url: string, body: unknown, options?: RequestOptions): Promise<FhirResource>; post(url: string, body: unknown, options?: RequestOptions): Promise<FhirResource>; patch(url: string, body: unknown, options?: RequestOptions): Promise<FhirResource>; } //# sourceMappingURL=http-client.d.ts.map