Computer Science A
Course Progress
0/0
OCS Build and Lesson
Code Runner - Java
Code Runner - Examples
Code Runner - JavaScript
FRQ - Methods and Control Structures
Challenge Submission Test
2021 FRQ 3
2023 FRQ 3
2024 FRQ 3
2024 FRQ 2
2024 FRQ 1
2024 FRQ 4
FRQ 2 - Sign Class
2023 FRQ 1
2021 FRQ 2
2019 FRQ 4
2019 FRQ 2
2019 FRQ 1
2016 FRQ 3
2018 FRQ Question 4
2018 FRQ Question 3
2018 FRQ Question 2
2018 FRQ Question 1
2017 FRQ 4
2017 FRQ 3
2017 FRQ Question 2
2017 FRQ 1
2016 FRQ 4
2016 FRQ 2
2016 FRQ Q1
FRQ - 2D Arrays
FRQ - ArrayLists
2025 FRQ 4
2025 FRQ 3
2025 FRQ 2
2025 FRQ 1
FRQ - Classes
FRQ - Array
2023 FRQ 4
2022 FRQ 4
2022 FRQ 3
2022 FRQ 2
2022 FRQ 1
2021 FRQ 4
2021 FRQ 1
2015 FRQ 4
2015 FRQ 2
2015 FRQ 1
2015 FRQ 3
2014 FRQ Q2 - Writing a Class
2019 FRQ 3
2014 FRQ 1
Sprint View
Week 21
Postman Guide
Postman Guide
2 min read
- Postman Intro Guide
- Common Status Codes
- Common HTTP Methods
- Why Use Postman?
- Write Backend Code in VS Code
- Test APIs in Postman
- VS Code vs Postman: Where To Find the Information
Postman Intro Guide
Quick Guide to Write & Test APIs with Postman
π
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 |