Why Use Postman?

  • Test backend without a frontend.
  • Quickly debug and explore APIs.
  • Save and organize requests for teamwork.

For more information past this lesson visit postman docs

1. Write Backend Code in VS Code

  • Define API routes in files like main.py or inside an api/ folder.
  • Use the terminal in VS Code to run your Flask server (python main.py).


VS Code and API route


2️. Test APIs in Postman

  • Choose method (GET, POST, etc.) and enter your API URL.


Postman Method and URL

  • Use Body → raw → JSON for sending data.


Postman JSON body

  • View status codes and response data in the panel below.


Postman response panel


3. VS Code vs Postman: Where To Find the Information

Backend (VS Code) Testing (Postman)
localhost url + endpoint type localhost url + endpoint into send bar
VS Code code Postman send
Find API call method Select HTTP method and enter URL, click Send
VS Code route Postman send
Use request.json to read JSON data Enter JSON data under Body → raw → JSON
VS Code JSON Postman JSON body
Handle cookies with request.cookies Manage cookies in Postman’s Cookies tab
VS Code cookies Postman cookies

4️. Common HTTP Methods Overview

Method Purpose Usage in VS Code Postman Tip
GET Retrieve data Route with methods=['GET'] No body needed
POST Create data Read JSON from request body Use Body tab to send JSON
PUT Replace data Replace full record Send full updated data
PATCH Update part Partial update logic Send partial JSON data
DELETE Remove data Delete from database No body needed