How to Test a REST API Without Postman: 4 Lightweight Ways
Test a REST API with an online tester, curl, a VS Code .http file or a short Node script, and check what actually matters beyond a 200 OK.

You do not need Postman to test a REST API. For most day-to-day checks, an online API tester, a one-line curl command, a .http file in VS Code or a 20-line Node script is faster, uses no extra RAM and leaves nothing to sync. I use all four, depending on whether I am poking at a third-party API, debugging my own backend, or turning a check into something I can run again tomorrow.
This guide shows each method with commands you can copy, and, more importantly, what to actually check, because "it returned 200" is where most API testing stops and most bugs hide.
What you are really checking when you test an API
Before picking a tool, know what a good test looks at. For every request I check five things:
- Status code. Not just "2xx", but the right one:
201 Createdafter a POST that creates something,204 No Contentafter a DELETE,401when the token is missing,404for an ID that does not exist. - Response headers.
Content-Typeshould match the body (application/json, nottext/htmlfrom an error page). Look forCache-Control, rate-limit headers such asRateLimit-RemainingorX-RateLimit-Remaining, andLocationafter a create. - Body shape. The fields your frontend relies on exist, have the right types, and are not
nullwhen they should not be. A 200 with{"success": false}inside is still a failure. - Error responses. Send bad input on purpose. A good API returns a
400with a message that names the bad field, not a500with a stack trace. - Timing and size. A response that takes 3 seconds or weighs 2 MB works in testing and hurts in production.
Keep this list in mind for every method below.
Method 1: An online API tester (no install)
When I just need to see what an endpoint returns, an online tester is the quickest option: paste the URL, pick the method, add headers, send.
With the DevTool House API Request Tester:
- Choose the method (GET, POST, PUT, PATCH, DELETE, HEAD or OPTIONS).
- Paste the full URL, including
https://. - Add headers such as
Authorization: Bearer <token>orAccept: application/json. - For POST, PUT and PATCH, paste a JSON body.
- Send, then read the status, response headers, body, time and size.
Two details matter with any online tester:
- CORS does not apply. The request is sent from the tester's server, not from your browser, so an API that blocks your frontend with a CORS error can still answer here. That makes an online tester a useful way to separate "the API is broken" from "the API does not allow my site's origin".
- It cannot reach
localhost. Your laptop's local server is not on the public internet. To test a local API, usecurlor a.httpfile on your own machine, or expose the port through a tunnel.
If the response is a long single line of JSON, paste it into the JSON Formatter to read it properly.
Method 2: curl, the tool that is already installed
curl ships with macOS, Linux and Windows 10 and later, so it works on every machine I touch, including servers over SSH.
A GET request that also prints the response headers (-i):
curl -i https://api.github.com/zen
A JSON POST request:
curl -i -X POST https://api.example.com/v1/orders \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN" \
-d '{"productId": 42, "quantity": 2}'
Timing, without the body:
curl -s -o /dev/null -w "status %{http_code}, %{time_total}s, %{size_download} bytes\n" https://api.github.com/zen
Three habits that save time with curl:
- Keep secrets in variables.
$TOKENkeeps the token out of your shell history and out of screenshots. - Use
-vwhen something is off. It shows the request headers curl actually sent, the TLS handshake and any redirects, which is where most "works in the browser but not in curl" puzzles are solved. - On Windows PowerShell 5.1, type
curl.exe. In that versioncurlis an alias forInvoke-WebRequest, which takes different options. PowerShell 7 removed the alias.
Method 3: A .http file in VS Code
For my own projects I keep a requests.http file next to the code. With the REST Client extension for VS Code, each request gets a "Send Request" link, and the file lives in Git like everything else, so the next developer gets working examples for free. JetBrains IDEs read the same format with their built-in HTTP client.
@baseUrl = http://localhost:8080/api/v1
@token = paste-a-dev-token-here
### Health check
GET {{baseUrl}}/health
### Create an order
POST {{baseUrl}}/orders
Content-Type: application/json
Authorization: Bearer {{token}}
{
"productId": 42,
"quantity": 2
}
### Missing token should return 401
POST {{baseUrl}}/orders
Content-Type: application/json
{ "productId": 42, "quantity": 2 }
The ### line separates requests. Variables at the top let you switch between local and staging by changing one line. Because this runs on your machine, localhost works.
Method 4: A small Node script with real assertions
When I want a check I can rerun before every deploy, I write it as a script. Node 18 and later have fetch built in, and node:assert is part of the standard library, so there is nothing to install:
// api-smoke-test.mjs -> run with: node api-smoke-test.mjs
import assert from 'node:assert/strict';
const BASE = 'https://jsonplaceholder.typicode.com';
const res = await fetch(`${BASE}/posts/1`);
assert.equal(res.status, 200);
assert.match(res.headers.get('content-type'), /application\/json/);
const post = await res.json();
assert.equal(post.id, 1);
assert.equal(typeof post.title, 'string');
const missing = await fetch(`${BASE}/posts/999999`);
assert.equal(missing.status, 404);
console.log('All API checks passed');
If any assertion fails, the script exits with an error and prints what was expected and what came back. That is exactly what you want in a CI step or a pre-deploy checklist. When the checks grow, move them into your test runner (Jest, Vitest, or Node's own node --test) without changing the idea.
Test the unhappy paths too
Most API bugs show up when something is wrong, not when everything is right. For each important endpoint, I send at least these on purpose:
| What to send | What a good API returns |
|---|---|
No Authorization header |
401 Unauthorized |
| A valid token for a user without access | 403 Forbidden |
| An ID that does not exist | 404 Not Found |
| A required field missing, or a wrong type | 400 Bad Request (or 422) naming the field |
| The wrong method, such as DELETE on a read-only route | 405 Method Not Allowed |
| Many requests in a short burst | 429 Too Many Requests, ideally with Retry-After |
If any of these returns 500, you have found a bug before your users did.
Common mistakes when testing APIs
- Forgetting
Content-Type: application/json. Many frameworks only parse the body as JSON when this header is present. Without it, the server sees an empty body and you get a confusing validation error. - A redirect that turns POST into GET. Calling
http://instead ofhttps://, or adding or removing a trailing slash, can trigger a301or302redirect. Browsers and most HTTP clients follow those by sending the next request as a GET, so your body disappears. Use the exact final URL. - Copying a token with a line break. A token pasted from a terminal or a chat app often carries a hidden newline or space, and the server rejects it. If a token that should work returns
401, paste it into the JWT Decoder to check that it decodes cleanly and has not expired. - Only checking the status. As above, read the body. A
200with an error object inside is still an error.
FAQ
How do I check if an API is working?
Send a simple GET request to a known endpoint (many APIs have /health or /status) and check three things: the status code is 200, the Content-Type is what you expect, and the body contains real data rather than an error message. An online API tester or curl -i <url> shows all three in one step.
Is there a free online alternative to Postman?
Yes. For one-off requests, an online API tester such as the DevTool House API Request Tester needs no account or install. For collections you want to keep, a .http file with the VS Code REST Client extension is free, works offline, and lives in your Git repository.
Can I test a localhost API with an online tool?
Not directly. An online tester sends the request from its own server, which cannot reach your machine's localhost. Use curl, a .http file, or a Node script locally, or expose the port with a tunnelling tool if you really need to reach it from outside.
Why does my API work in Postman but not in the browser?
Usually CORS. Postman, curl and online testers do not enforce CORS, but browsers do. If your frontend gets a CORS error while other tools work, the API is reachable; it just does not include your site's origin in its Access-Control-Allow-Origin response header.
How do I test a POST request online?
Choose POST in the tester, add a Content-Type: application/json header, paste the JSON body, and send. Then check that the status is 201 or 200 and that the response contains the object you created.
Try the related tools
Related articles

QR Code Not Scanning? 12 Causes and How to Fix Each One
Work out in thirty seconds whether the problem is the code, the print, the link, or the phone — then fix it with the matching remedy.
Read article
QR Code Size Guide for Print: Minimum Size and Scan Distance
How big a printed QR code needs to be, the 10:1 distance rule, the pixel maths for 300 DPI, and why the quiet zone matters more than the size.
Read article
How to Make a QR Code for a Link, PDF, or Google Form
All three are the same job with different starting points. How to get a shareable link that will not break, and the permission mistakes that kill printed codes.
Read article