const response = await fetch("/api/test", { method: "get", headers: { "Content-Type": "application/json" } }); console.info(`status: ${response.status}`); let json; try { json = await response.json(); } catch (e) { console.error(e); json = JSON.stringify({}); } finally { console.info(json); }