1 | import { Readable } from "node:stream";
|
2 | export interface FetchRequestConfig {
|
3 | headers?: Record<string, string>;
|
4 | }
|
5 | interface httpFetchClientConfig {
|
6 | baseURL: string;
|
7 | defaultHeaders: Record<string, string>;
|
8 | }
|
9 | export declare function convertResponseToReadable(response: Response): Readable;
|
10 | export 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 | }
|
24 | export {};
|
25 |
|
\ | No newline at end of file |