Testing API Endpoints: Manual Validation with cURL and Postman
Learn how to manually test your API endpoints using cURL and Postman. Validate HTTP responses, status codes, and JSON payloads to ensure your API works as designed.

Previously in this course, we focused on generating interactive documentation with Swagger UI. While documentation helps others understand your API, you need a reliable way to verify that your code actually behaves as described. In this lesson, we shift from documentation to manual verification.
Testing your API manually is the fastest way to catch "off-by-one" errors in your routing, unexpected status codes, or malformed JSON payloads. We will use two industry-standard tools: cURL for command-line speed and Postman for visual request management.
Why Manual Validation Matters
Before you write automated test suites, you must possess the ability to perform ad-hoc validation. When you deploy a new endpoint or tweak your standardized response envelopes, you need immediate feedback.
Manual testing allows you to:
- Verify HTTP Semantics: Check if your GET and POST semantics are correctly implemented.
- Inspect Headers: Ensure that content types (
application/json) and version headers are present. - Debug Edge Cases: Manually trigger specific scenarios, like sending an empty body or an invalid ID, to see how your server handles errors.
Testing with cURL

cURL is the universal language of APIs. It comes pre-installed on most Unix-based systems and is perfect for quick sanity checks.
To test your GET /v1/tasks endpoint, open your terminal and run:
Bashcurl -i -X GET http://localhost:3000/v1/tasks
The -i flag is crucial here; it tells cURL to include the HTTP response headers in the output. The -X flag specifies the request method. You should see a response like this:
HTTPHTTP/1.1 200 OK Content-Type: application/json; charset=utf-8 { "data": [...], "meta": { "total": 10 } }
If you need to test a POST request with a payload, use the -d (data) flag:
Bashcurl -i -X POST http://localhost:3000/v1/tasks \ -H "Content-Type: application/json" \ -d '{"title": "Learn API Testing", "status": "pending"}'
Visual Validation with Postman
While cURL is excellent for quick tasks, Testing with Postman: A Guide for API Quality Assurance is far superior for complex workflows. Postman provides a GUI to save requests, manage environment variables, and view structured JSON responses.
Steps to Validate an Endpoint:
- Create a Collection: Group your Task Manager requests by version (e.g., "Task API v1").
- Define the Request: Set the method to
POSTand the URL tohttp://localhost:3000/v1/tasks. - Set the Body: Select the "raw" body type and choose "JSON". Paste your payload there.
- Send and Assert: After clicking "Send", look at the "Tests" tab. You can write simple JavaScript assertions here, such as:
JAVASCRIPTpm.test("Status code is 201", function () { pm.response.to.have.status(201); }); pm.test("Response has data field", function () { pm.response.to.have.jsonBody("data"); });
Hands-on Exercise
- Open your Task Manager project and ensure your server is running.
- Using cURL, retrieve your tasks and verify the response header
Content-Typeisapplication/json. - Using Postman, create a new
POSTrequest to create a task. Verify that your API returns a201 Createdstatus code and the correct JSON response structure. - Attempt to send a request with a missing required field (e.g., missing
title) and verify that your API returns a400 Bad Request.
Common Pitfalls
- Ignoring the Status Code: Developers often only look at the response body. If your API returns
200 OKwhen it should have returned201 Createdfor a resource creation, your API is technically failing its contract. - Hardcoding URLs: In Postman, avoid hardcoding
localhost:3000directly into requests. Use "Environments" to switch betweenlocalhostand your production server easily. - Forgetting Content-Type: If you don't send
Content-Type: application/jsonin your request headers, your server-side framework might fail to parse the body correctly, leading to mysteriousnullerrors.
FAQ
Q: Should I use cURL or Postman? A: Use cURL for quick debugging and CI/CD scripts. Use Postman for complex testing, team collaboration, and maintaining a library of test cases.
Q: Does manual testing replace automated testing? A: Absolutely not. Manual testing is for discovery and initial verification. Unit testing your API endpoints is essential for long-term maintenance.
Q: Why do I get a 403 or 404 error?
A: Double-check your route path (e.g., ensure you are using /v1/ as we implemented in implementing versioned routes).
Recap
We successfully verified our Task Manager API by manually sending requests and inspecting responses. By using cURL for CLI efficiency and Postman for structured validation, you can now confirm that your endpoints meet the design requirements before moving to more advanced topics.
Up next: We will discuss Error Handling Best Practices to ensure your API provides meaningful feedback when things go wrong.
Work with me

Laravel REST API Development
Clean, secure, well-documented Laravel REST APIs โ the backend engine for your app, mobile client, or SaaS. Built by an API specialist.

Headless WordPress + Next.js Frontend Development
Keep WordPress for content, get a lightning-fast Next.js frontend. The best of both worlds โ familiar editing, modern speed.

