API Fundamentals Course
API Fundamentals
/
Beginner

Postman

Definition

A highly popular desktop application used by developers to manually build, send, and test HTTP requests against APIs without writing any frontend code.

Explain Like I'm New

Before you build a React app to talk to an API, you need to make sure the API actually works. Postman is a graphical interface where you type in a URL, pick 'GET' or 'POST', click 'Send', and it formats the JSON response beautifully on the screen.

Real World Example

A backend developer finishes building a new `/checkout` API. Instead of waiting for the frontend team to build the shopping cart UI, they use Postman to simulate a checkout request and verify the database updates.

Common Use Cases

  • Manual API testing
  • Saving request collections
  • Debugging

Terminal Output

bash / terminal
/* How to structure a Postman Collection for a new API: 📁 E-Commerce API (Collection) 📁 Auth - 🟢 POST /login (Saves token to environment) - 🟢 POST /register 📁 Products - 🔵 GET /products - 🔵 GET /products/:id - 🟡 PUT /products/:id (Uses Admin Token) - 🔴 DELETE /products/:id (Uses Admin Token) */

Interview Questions

basic

  • What is a Postman 'Collection'?

intermediate

  • How can you use Postman to handle Authentication tokens automatically across multiple requests?

Flash Cards

Question

What is a Collection?

Click to reveal answer
Answer

A group of saved API requests organized into folders. You can share a Collection with your team so everyone can test the API easily.

Question

Handle auth automatically?

Click to reveal answer
Answer

You can configure a Postman 'Environment Variable'. When you hit the `/login` endpoint, you write a tiny script in Postman to extract the JWT from the response and save it to the variable. You then configure the Collection to attach that variable to the `Authorization` header of all other requests automatically.