@tf2pickup-org/serveme-tf-client
Version:
A serveme.tf API client
18 lines (17 loc) • 742 B
TypeScript
import { HttpMethod } from './http-method';
interface HttpClientOptions {
baseUrl?: string;
params?: Record<string, string>;
}
export declare class HttpClient {
readonly baseUrl?: string;
readonly params?: Record<string, string>;
constructor(options: HttpClientOptions);
request<Response, Body extends object = object>(method: HttpMethod, path: string, body?: Body): Promise<Response>;
get<Response>(path: string): Promise<Response>;
post<Response, Body extends object = object>(path: string, body: Body): Promise<Response>;
put<Response, Body extends object = object>(path: string, body: Body): Promise<Response>;
delete<Response>(path: string): Promise<Response>;
private createUrl;
}
export {};