Send POST Request

Send an HTTP POST request with a JSON body and optional headers.

export async function main(
  url: string,
  body: object = {},
  headers: Record<string, string> = {}
) {
  const response = await fetch(url, {
    method: 'POST',
    headers: { 'Content-Type': 'application/json', ...headers },
    body: JSON.stringify(body)
  })
  return await response.json()
}