本页还没有译文
本页 3 段还没译成日本語,下面显示的是英文原文。Send an HTTP request using fetch
还没翻译译自英文(bun.com)本页 3 段都还没译
Bun implements the Web-standard fetch API for sending HTTP requests. To send a GET request to a URL:
const response = await fetch("https://bun.com");
const html = await response.text(); // HTML stringTo send a POST request to an API endpoint:
const response = await fetch("https://bun.com/api", {
method: "POST",
body: JSON.stringify({ message: "Hello from Bun!" }),
headers: { "Content-Type": "application/json" },
});
const body = await response.json();AI 翻译查看英文原文