Vanilla JavaScript Projects

Project 49, Developer tools

Mini Postman API Client

Test any API from the browser. Build a request, send it, and read a clean response with timing. Save the ones you use often and copy them as cURL.

GET 200 OK142 ms · 1.2 KB
Main API
Fetch with AbortController
Saves to
localStorage
Dependencies
None
Your browser
Checking

API client

Ready
Send a request to see the response.

How it works

  1. Build the requestThe URL, params, headers and body are combined, and {{variables}} are filled in from the environment.
  2. Send with limitsfetch runs with a signal that aborts on your timeout or when you press Cancel.
  3. Read the responseThe body is streamed to count bytes and show progress, then shown as pretty JSON or plain text.
const controller = new AbortController();
const signal = AbortSignal.any([controller.signal, AbortSignal.timeout(15000)]);
const t0 = performance.now();
const res = await fetch(url, { method, headers, body, signal });

let bytes = 0; const chunks = [];
const reader = res.body.getReader();
for (let r; !(r = await reader.read()).done; ) { chunks.push(r.value); bytes += r.value.length; }
const text = new TextDecoder().decode(await new Blob(chunks).arrayBuffer());
show(res.status, performance.now() - t0, bytes, text, [...res.headers]);
// Cancel button: controller.abort()