π
Background Knowledge
Understand APIs & HTTP basics
β
β
Why Use Postman?
Test backend without a frontend
β
βοΈ
Write Backend Code
Define API routes in VS Code
β
π§ͺ
Test APIs
Send requests and inspect responses
β
βοΈ
VS Code vs Postman
Where to find info
Common Status Codes
Status Code |
Meaning |
When to Expect |
200 OK |
Request succeeded |
Successful GET, POST, PUT, PATCH, DELETE |
201 Created |
Resource created |
Successful POST that creates a resource |
204 No Content |
Request succeeded, no response body |
Successful DELETE or PUT with no response content |
400 Bad Request |
Malformed request syntax or invalid data |
When request JSON or parameters are invalid |
401 Unauthorized |
Authentication required or failed |
Missing or invalid auth token/cookie |
403 Forbidden |
Authenticated but not allowed |
Access denied for user to resource |
404 Not Found |
Resource not found |
Invalid endpoint or missing resource |
500 Internal Server Error |
Server encountered an error |
Unhandled exceptions or errors on backend |
Common HTTP Methods
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 |
Why Use Postman?
- Test backend code (in python flask, java spring, etc.) without having a functional frontend . This allows for students to work on and test different pieces of the project seperately before joining them together. .
- Allows for quick debugging of APIs + Test Cookie/Token storage that may be generated by the backend (typically for authorization).
- Has its own collaboration system such as shared workspaces and collections where team members can share postman requests.
Pro Coder Tip: For more info on any tool (in this case postman) visit its offical documentation Postman Docs
Write Backend Code in VS Code
- 1. Create API endpoints in an api file (flask framework) + define in main.py
- 2. Use the terminal in VS Code to run your Flask localhost server (
python main.py
).
Test APIs in Postman
- Choose method (GET, POST, etc.) and enter your API URL (which consists of your endpoint from your code + local host server from python main.py.
- Use Body β raw β JSON to send data for POST/PUT requests.
- View status codes and response data in the panel below.
VS Code vs Postman: Where To Find the Information
Backend (VS Code) |
Testing (Postman) |
localhost url + endpoint |
type localhost url + endpoint into send bar |
 |
 |
Find API call method |
Select HTTP method and enter URL, click Send |
 |
 |
Use request.json to read JSON data |
Enter JSON data under Body β raw β JSON |
 |
 |
Handle cookies with request.cookies |
Manage cookies in Postmanβs Cookies tab |
 |
 |
</body>
</html>