export const http = { async get(url: string, options?: RequestInit): Promise { const response = await fetch(url, { ...options, method: 'GET' }); if (!response.ok) { throw new Error(`HTTP GET failed with status ${response.status}`); } return response.json() as Promise; }, async post(url: string, body?: unknown, options?: RequestInit): Promise { const response = await fetch(url, { ...options, method: 'POST', headers: { 'Content-Type': 'application/json', ...(options?.headers ?? {}), }, body: body ? JSON.stringify(body) : undefined, }); if (!response.ok) { throw new Error(`HTTP POST failed with status ${response.status}`); } return response.json() as Promise; }, };