Learn How to Use Postman for API Testing: A Step-by-Step Manual

Payal PorwalPayal Porwal
3 min read

Here's your complete beginner-friendly step-by-step guide to using Postman for the Express.js project we built in Day 11 (Student API).


🎯 Goal

You will learn how to use Postman to test these API routes:

MethodRouteDescription
GET/studentsGet all students
POST/studentsAdd a student
PUT/students/:idUpdate a student
DELETE/students/:idDelete a student

🧰 What You Need

βœ… Your Express server running on http://localhost:5000
βœ… Postman installed

πŸ‘‰ Download Postman and install it (if not already)


πŸ§ͺ Step-by-Step: Testing with Postman


βœ… Step 1: Open Postman

  • After opening Postman, click on "New" β†’ "HTTP Request"

  • A tab will open to create your first API request


βœ… Step 2: Test GET Request

Goal: Fetch all students from your API

  1. Select method: GET

  2. URL:

     http://localhost:5000/students
    
  3. Click Send

πŸ“₯ You will get a response like:

[
  { "id": 1, "name": "Payal" },
  { "id": 2, "name": "Amit" }
]

βœ… Step 3: Test POST Request

Goal: Add a new student

  1. Select method: POST

  2. URL:

     http://localhost:5000/students
    
  3. Click on Body tab

  4. Select raw

  5. From dropdown on right, choose JSON

  6. Paste this JSON:

{
  "name": "Ravi"
}
  1. Click Send

πŸ“€ You’ll get a response like:

{ "id": 3, "name": "Ravi" }

βœ… Also, now GET request will include Ravi!


βœ… Step 4: Test PUT Request (Update Student)

Goal: Update a student’s name

  1. Select method: PUT

  2. URL (use a real ID, example 2):

     http://localhost:5000/students/2
    
  3. Go to Body β†’ raw β†’ JSON

  4. Paste:

{
  "name": "Updated Amit"
}
  1. Click Send

πŸ“€ Response:

{ "id": 2, "name": "Updated Amit" }

βœ… Step 5: Test DELETE Request

Goal: Delete a student

  1. Select method: DELETE

  2. URL (use the ID you want to delete, like 3):

     http://localhost:5000/students/3
    
  3. Click Send

πŸ“€ Response:

{ "message": "Student deleted successfully" }

πŸ‘€ Tips for Beginners

  • Always use GET from the browser, but for POST, PUT, and DELETE, Postman is the best tool

  • If you get Cannot GET /students, check if your server is running

  • Restart server if you change index.js

  • If Postman hangs, check port, check firewall, or restart app


πŸ’‘ Bonus: Save Requests as a Collection

  1. Click Save near Send button

  2. Create a Collection called Student API

  3. Save all requests (GET, POST, PUT, DELETE) inside it
    βœ… Now you can access them anytime without rewriting.


βœ… Summary

What You DidMethodURL Example
Get allGEThttp://localhost:5000/students
Add newPOSThttp://localhost:5000/students
UpdatePUThttp://localhost:5000/students/2
DeleteDELETEhttp://localhost:5000/students/3

πŸ”” Stay Connected

If you found this article helpful and want to receive more such beginner-friendly and industry-relevant Node JS notes, tutorials, and project ideas β€” πŸ“© Subscribe to our newsletter by entering your email below.

And if you're someone who wants to prepare for tech interviews while having a little fun and entertainment, πŸŽ₯ Don’t forget to subscribe to my YouTube channel – Knowledge Factory 22 – for regular content on tech concepts, career tips, and coding insights!

Stay curious. Keep building. πŸš€

0
Subscribe to my newsletter

Read articles from Payal Porwal directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Payal Porwal
Payal Porwal

Hi there, tech enthusiasts! I'm a passionate Software Developer driven by a love for continuous learning and innovation. I thrive on exploring new tools and technologies, pushing boundaries, and finding creative solutions to complex problems. What You'll Find Here On my Hashnode blog, I share: πŸš€ In-depth explorations of emerging technologies πŸ’‘ Practical tutorials and how-to guides πŸ”§Insights on software development best practices πŸš€Reviews of the latest tools and frameworks πŸ’‘ Personal experiences from real-world projects. Join me as we bridge imagination and implementation in the tech world. Whether you're a seasoned pro or just starting out, there's always something new to discover! Let’s connect and grow together! 🌟