Chuyển tới nội dung chính
kitlocal.dev

Trình tạo yêu cầu HTTP

Chạy cục bộ

Xử lý 100% ngay trong trình duyệt. Dữ liệu đầu vào và kết quả không rời khỏi thiết bị.

Xây dựng trực quan yêu cầu HTTP với phương thức, header, body và sinh mã JavaScript Fetch API sẵn sàng sử dụng.

Danh sách Header
Dữ liệu Body yêu cầu (Thô)
Mã JavaScript 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));