Files
wehub-resource-sync d88fd01084
CI / test (3.10) (push) Failing after 1s
CI / test (3.12) (push) Failing after 0s
CI / skillgen-check (push) Failing after 0s
CI / security-scan (push) Failing after 0s
chore: import upstream snapshot with attribution
2026-07-13 12:09:14 +08:00

24 lines
517 B
TypeScript

import { Response } from './models';
class HttpClient {
private baseUrl: string;
constructor(baseUrl: string) {
this.baseUrl = baseUrl;
}
async get(path: string): Promise<Response> {
return fetch(this.baseUrl + path);
}
async post(path: string, body: unknown): Promise<Response> {
return this.get(path);
}
}
function buildHeaders(token: string): Record<string, string> {
return { Authorization: `Bearer ${token}` };
}
export { HttpClient, buildHeaders };