@tokenizer/http
Version:
HTTP tokenizer for Node.js and browser
21 lines (20 loc) • 679 B
TypeScript
import type { IHeadRequestInfo, IRangeRequestResponse, IRangeRequestClient } from '@tokenizer/range';
/**
* Configuration options for the HTTP client.
*/
export type HttpClientConfig = {
resolveUrl?: boolean;
};
/**
* Simple HTTP-client, which works both in node.js and browser
*/
export declare class HttpClient implements IRangeRequestClient {
private url;
resolvedUrl?: string;
private readonly config;
private readonly abortController;
constructor(url: string, config?: HttpClientConfig);
getHeadInfo(): Promise<IHeadRequestInfo>;
getResponse(method: string, range?: [number, number]): Promise<IRangeRequestResponse>;
abort(): void;
}