UNPKG

@jjdenhertog/ai-driven-development

Version:

AI-driven development workflow with learning capabilities for Claude

12 lines (11 loc) 365 B
export async function postJson<T>(url: string, data: unknown): Promise<T> { const response = await fetch(url, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(data), }) if (!response.ok) { throw new Error(`Failed to post: ${response.statusText}`) } return response.json() }