跳至主要內容
kitlocal.dev

HTTP 請求建構器

本機執行

100% 在你的瀏覽器中處理。輸入與輸出絕不會離開你的裝置。

以視覺化方式建立 API 端點請求,並產生 JavaScript Fetch 程式碼。

標頭資料
請求內文資料(原始)
原生 Fetch() 包裝程式碼
fetch("https://api.example.com/v1/auth/login", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Authorization": "Bearer token123",
  },
  body: JSON.stringify({
    "username": "admin",
    "password": "supersecurepassword"
  }),
})
  .then((response) => response.json())
  .then((data) => console.log(data));