API Testing Without Postman: Lightweight Alternatives
Postman is a full API platform with collections, team workspaces, and an account system. For a quick endpoint check, a webhook you are debugging, or a test in CI, you may not need any of that. This guide covers what you can do with tools you already have: curl, the browser console, and a browser-based request form.
cURL: The Universal API Testing Tool
curl ships with macOS, most Linux distributions, and Windows 10 and later, and API documentation very often gives its examples as curl commands. On Windows PowerShell 5.1, curl is an alias for Invoke-WebRequest, so type curl.exe to run the real thing.
Basic GET Request
# Simple GET
curl https://api.example.com/users
# GET with headers
curl -H "Accept: application/json" \
-H "X-API-Key: your-key-here" \
https://api.example.com/users
# GET with query parameters
curl "https://api.example.com/users?page=2&limit=10"
POST with JSON Body
# POST JSON data
curl -X POST https://api.example.com/users \
-H "Content-Type: application/json" \
-d '{"name": "Alice", "email": "[email protected]"}'
# POST from a file
curl -X POST https://api.example.com/users \
-H "Content-Type: application/json" \
-d @payload.json
Debugging with -v
The -v (verbose) flag shows the full exchange, including request and response headers, TLS handshake details, and redirects. Reach for it first when a request is not doing what you expect.
curl -v https://api.example.com/health
# Output shows:
# > GET /health HTTP/2
# > Host: api.example.com
# > Accept: */*
# >
# < HTTP/2 200
# < content-type: application/json
# < x-request-id: abc-123
# <
# {"status": "ok"}
Other useful flags: -i prints the response headers along with the body, -I sends a HEAD request and shows only the headers, -o /dev/null discards the body (useful with -w for timing), and -L follows redirects.
Using fetch() in Browser DevTools
Every modern browser has a JavaScript console where you can use the Fetch API directly. Open DevTools (F12), go to the Console tab, and you have a fully capable HTTP client.
// Simple GET
const res = await fetch('https://api.example.com/users');
const data = await res.json();
console.table(data);
// POST with auth
const created = await fetch('https://api.example.com/users', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer your-token-here'
},
body: JSON.stringify({
name: 'Bob',
email: '[email protected]'
})
});
console.log(created.status);
console.log(await created.json());
The console lets you inspect arrays with console.table(), expand nested objects, and see the full exchange in the Network tab. The drawback is CORS, covered below: the console runs in the context of the page you have open, so requests are subject to that page's origin.
Browser-Based API Testers
If you prefer a form to a command line, the BoltQuickTools API Tester gives you fields for the method, URL, headers, and body, then shows the status, timing, response headers, and syntax-highlighted JSON. It runs in your browser using fetch(), so your request goes directly from your browser to the URL you enter, and the same CORS limits apply.
A form is easier than a command line when a request has many headers, or when you want formatted JSON without piping to jq. It also works on a machine where you cannot install anything. curl is better for anything you want to script or for APIs that do not allow cross-origin browser requests.
To inspect a large response, paste it into the JSON Formatter, or check its structure with the JSON Schema Validator.
Converting cURL to Code
A common workflow is to get a request working with curl, then translate the command into your application's language:
# This cURL command...
curl -X POST https://api.stripe.com/v1/charges \
-u sk_test_abc123: \
-d amount=2000 \
-d currency=usd \
-d source=tok_visa
# ...becomes this in Python (requests):
import requests
response = requests.post(
'https://api.stripe.com/v1/charges',
auth=('sk_test_abc123', ''),
data={
'amount': 2000,
'currency': 'usd',
'source': 'tok_visa'
}
)
# ...or this in JavaScript (fetch):
const response = await fetch('https://api.stripe.com/v1/charges', {
method: 'POST',
headers: {
'Authorization': 'Basic ' + btoa('sk_test_abc123:'),
'Content-Type': 'application/x-www-form-urlencoded'
},
body: 'amount=2000¤cy=usd&source=tok_visa'
});
The cURL to Code converter automates this translation for JavaScript (fetch or axios), Python, PHP, Go, Ruby, Java, and C#, including the auth encoding and body formats that are easy to get wrong by hand.
Testing Authentication
Most APIs require some form of authentication. Here are the three most common patterns and how to test each one.
API Keys
# As a header (most common)
curl -H "X-API-Key: your-key-here" \
https://api.example.com/data
# As a query parameter (less secure, avoid if possible)
curl "https://api.example.com/data?api_key=your-key-here"
Bearer Tokens (OAuth 2.0 / JWT)
# Bearer token in Authorization header
curl -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..." \
https://api.example.com/me
If you are working with JWTs and need to inspect what is inside the token (claims, expiration, issuer), the JWT Decoder will parse it instantly without sending the token anywhere.
Basic Auth
# cURL handles Basic auth natively with -u
curl -u username:password https://api.example.com/data
# This is equivalent to:
curl -H "Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=" \
https://api.example.com/data
# (The value is base64-encoded "username:password")
Reading API Responses
Status Codes
The HTTP status code is the first thing to check. Here are the ones you will encounter most:
- 200 OK: Request succeeded. Response body contains the data.
- 201 Created: Resource was created successfully. Usually returned after a POST.
- 204 No Content: Success, but no body. Common for DELETE operations.
- 400 Bad Request: Your request is malformed. Check the body format and required fields.
- 401 Unauthorized: Authentication failed. Check your API key or token.
- 403 Forbidden: Authentication succeeded but you lack permission for this resource.
- 404 Not Found: The endpoint or resource does not exist. Check the URL.
- 429 Too Many Requests: Rate limited. Check the
Retry-Afterheader. - 500 Internal Server Error: The server broke. Not your fault (probably).
Response Headers
Look for Content-Type to know the response format, X-Request-Id to quote when contacting the API provider, and Link for pagination URLs. Many APIs also report your remaining quota in headers such as X-RateLimit-Remaining, but the names are not standardized, so check the provider's documentation.
JSON Response Bodies
Most modern APIs return JSON. When the response is complex or deeply nested, pipe it through a formatter for readability:
# cURL piped to jq (if installed)
curl -s https://api.example.com/users | jq '.'
# Or paste the raw JSON into the BoltQuickTools JSON Formatter
# for syntax highlighting and collapsible sections
Common Pitfalls
CORS in the Browser
If a request from the browser fails with a CORS error, the API may be working fine. The server has not allowed your page's origin in its Access-Control-Allow-Origin header, and the browser is enforcing that. The same request works from curl or server-side code. Testers that send requests through their own server avoid this, but that means the server sees your request. Client-only testers, including the one on this site, hit the same restriction. See the CORS debugging guide for how to diagnose it.
SSL Certificate Errors
# Skip SSL verification (development only, NEVER in production)
curl -k https://localhost:8443/api/health
# The proper fix: add your dev CA certificate
curl --cacert /path/to/dev-ca.crt https://localhost:8443/api/health
Timeouts
# Set connection and read timeouts
curl --connect-timeout 5 --max-time 30 \
https://api.example.com/slow-endpoint
Building a Simple Test Script
For checks you want to repeat in CI or on your own machine, a short shell script is often enough:
#!/bin/bash
# api-tests.sh
BASE_URL="https://api.example.com"
API_KEY="your-test-key"
PASS=0
FAIL=0
check() {
local name="$1"
local expected="$2"
local actual="$3"
if [ "$actual" = "$expected" ]; then
echo "PASS: $name"
PASS=$((PASS + 1))
else
echo "FAIL: $name (expected $expected, got $actual)"
FAIL=$((FAIL + 1))
fi
}
# Test 1: Health check returns 200
status=$(curl -s -o /dev/null -w "%{http_code}" "$BASE_URL/health")
check "Health endpoint" "200" "$status"
# Test 2: Auth required returns 401
status=$(curl -s -o /dev/null -w "%{http_code}" "$BASE_URL/users")
check "Unauthed request" "401" "$status"
# Test 3: Authed request returns 200
status=$(curl -s -o /dev/null -w "%{http_code}" \
-H "X-API-Key: $API_KEY" "$BASE_URL/users")
check "Authed request" "200" "$status"
# Test 4: Create user returns 201
status=$(curl -s -o /dev/null -w "%{http_code}" \
-X POST -H "Content-Type: application/json" \
-H "X-API-Key: $API_KEY" \
-d '{"name":"Test","email":"[email protected]"}' \
"$BASE_URL/users")
check "Create user" "201" "$status"
echo ""
echo "Results: $PASS passed, $FAIL failed"
[ $FAIL -eq 0 ] && exit 0 || exit 1
Each check is a plain curl command, so the script runs anywhere curl and bash are available, and the non-zero exit code fails a CI job when any check fails.
To sum up: use curl for anything you want to script, the browser console for quick checks against APIs that allow your origin, and the API Tester when you would rather fill in a form.