UNPKG

1.14 kBTypeScriptView Raw
1import { Readable } from "node:stream";
2export interface FetchRequestConfig {
3 headers?: Record<string, string>;
4}
5interface httpFetchClientConfig {
6 baseURL: string;
7 defaultHeaders: Record<string, string>;
8}
9export declare function convertResponseToReadable(response: Response): Readable;
10export default class HTTPFetchClient {
11 private readonly baseURL;
12 private readonly defaultHeaders;
13 constructor(config: httpFetchClientConfig);
14 get<T>(url: string, params?: any): Promise<Response>;
15 post(url: string, body?: any, config?: Partial<FetchRequestConfig>): Promise<Response>;
16 put(url: string, body?: any, config?: Partial<FetchRequestConfig>): Promise<Response>;
17 postForm(url: string, body?: any): Promise<Response>;
18 postFormMultipart(url: string, form: FormData): Promise<Response>;
19 putFormMultipart(url: string, form: FormData, config?: Partial<FetchRequestConfig>): Promise<Response>;
20 postBinaryContent(url: string, body: Blob): Promise<Response>;
21 delete(url: string, params?: any): Promise<Response>;
22 private checkResponseStatus;
23}
24export {};
25//# sourceMappingURL=http-fetch.d.ts.map
\No newline at end of file