India · Dubai · Delivering worldwide+91 86603 71224info@pyalm.com
Pyalm Labs logo
Free Tools

How to Test a REST API: Methods, Status Codes, Headers and CORS

A practical introduction to testing APIs — HTTP methods, reading status codes and headers, authentication, and why browser requests hit CORS errors.

Editorial disclosure: Pyalm publishes and maintains the products and free tools discussed on this site. Regulatory statements are linked to primary sources where applicable. No independent professional review is claimed unless a reviewer is explicitly named.

Whether you're integrating a payment gateway, a WhatsApp API or your own backend, the first step is the same: send a request and look carefully at what comes back.

HTTP methods

Method Meaning Has a body
GET Read data No
POST Create something Yes
PUT Replace something Yes
PATCH Update part of something Yes
DELETE Remove something Usually no
HEAD / OPTIONS Headers only / ask what's allowed No

Status codes to recognise

Code Meaning Usually means
200 / 201 OK / Created Success
204 No Content Success with an empty body
301 / 302 Redirect Check the Location header
400 Bad Request Your body or parameters are malformed
401 Unauthorized Missing or invalid credentials
403 Forbidden Authenticated but not allowed
404 Not Found Wrong URL or ID
409 / 422 Conflict / Unprocessable Validation failed — read the error body
429 Too Many Requests Rate limited — back off
500 / 502 / 503 Server errors Not your fault (usually) — retry later

Send your first request

  1. Open the free API Tester.
  2. Pick a method and enter the URL — or try one of the example APIs.
  3. Add query parameters, headers (e.g. Accept: application/json), a bearer token and a JSON body as needed.
  4. Click Send and inspect the status, timing, size, headers and formatted body.
  5. Copy the request as cURL or fetch() for your code or documentation.

Requests go straight from your browser to the API; nothing passes through Pyalm.

Authentication patterns

  • Bearer tokens — Authorization: Bearer eyJ… (decode JWTs with the JWT Decoder)
  • API keys — in a header like X-API-Key or a query parameter
  • Basic auth — Authorization: Basic + Base64 of user:password

Never paste production secrets into shared docs or tickets.

Understanding CORS errors

Browsers block a web page from reading responses from another domain unless that API sends Access-Control-Allow-Origin headers. Many server-to-server APIs don't, so a browser-based tester shows "Failed to fetch" even though the API works fine. Copy the request as cURL and run it in a terminal — terminals don't enforce CORS.

Good testing habits

  • Test the unhappy paths: missing fields, wrong types, expired tokens.
  • Check response times as well as results.
  • Validate JSON bodies with the JSON Formatter.
  • Compare responses between versions with JSON Compare.

Need an integration built?

Pyalm builds APIs and integrations — ERPs, payment gateways, WhatsApp, e-invoicing platforms — and automation that keeps your systems in sync.

API Tester | JSON Formatter | JWT Decoder | URL Encoder | All free tools

Keep reading

More from Pyalm

Nov 27, 2026

Prescription Abbreviations: What OD, BD, TDS, SOS and 1-0-1 Mean

A plain-English list of prescription abbreviations: dose timing (OD, BD, TDS, QID), when to take (AC, PC, HS, SOS), routes, forms, the 1-0-1 dose grid and abbreviations to avoid.

Nov 27, 2026

Handwritten vs Typed Prescriptions: Which Is Safer?

Why legibility matters in prescribing, what changes when clinics move from handwritten to typed or electronic prescriptions, and how to keep a handwritten signature.

Nov 27, 2026

How to Write a Prescription in India: Format and Rules

A practical prescription format for doctors in India: required details, generic names in capitals, the 1-0-1 grid, Schedule H and controlled drugs, and keeping records.

Nov 27, 2026

Prescription Pad Design: Letterhead Template for Clinics

What a professional prescription letterhead should include, paper size, layout, bilingual Arabic and English pads, QR codes for verification and printing tips.

Nov 27, 2026

Prescription Errors: 10 Common Mistakes and How Clinics Prevent Them

The ten prescription mistakes that cause dispensing errors, from illegible names and decimal points to missing durations, and simple fixes for clinics.

Oct 16, 2026

How to Format and Validate JSON (and Fix the 6 Most Common Errors)

Why JSON breaks, how to read a validator's error message, and a quick routine for pretty-printing, minifying and fixing JSON from APIs, logs and config files.

Try the free API Tester (REST Client)

Pyalm builds APIs and integrations — connecting ERPs, payment gateways, WhatsApp and e-invoicing platforms — for businesses in India and the UAE.

Open API Tester (REST Client) See custom software All free tools