This is a basic Flask application that implements a simple Student API. You can use this API to manage student data (CRUD operations: Create, Read, Update, Delete).
- Python 3.x (https://www.python.org/downloads/)
- Flask (https://flask.palletsprojects.com/)
- Apidog for testing (https://apidog.com)
- Clone or download this repository
git clone https://github.com/vjabhi000985/python-flask-api.git - Install the required dependencies:
pip install flask json - Run the Flask application:
python student_api.py
This will start the Flask development server, typically running on http://127.0.0.1:5000 by default.
- In the Apidog editor, navigate to the GET /students endpoint.
- Click "Send". You should see a response with a JSON array containing all student objects (refer to screenshot.
- Navigate to the GET /students/{roll} endpoint (replace {roll} with a valid student ID).
- Click "Send". You should see a response with the details of the specific student if it exists. Otherwise, expect a 404 Not Found error.
- Navigate to the POST /students endpoint.
- Click on the "Body" tab and select "JSON".
- Paste the following JSON data into the body, replacing placeholders with desired values:
{
"name": "John Doe",
"branch": "Computer Science"
}
# Use code with caution.- Click "Send". You should receive a status code 201 Created and a Location header pointing to the newly created student's resource URL.
- Navigate to the PUT /students/{roll} endpoint (replace {roll} with a valid student ID).
- In the Body tab, provide updated student information in JSON format (e.g., update the name).
- Click "Send". You should receive a status code 200 OK and the updated student data in the response.
- Navigate to the DELETE /students/{roll} endpoint (replace {roll} with a valid student ID).
- Click "Send". You should receive a status code 200 OK with the deleted student's information in the response (optional, depending on your implementation).
Developed by Pandey Abhishek Nath Roy [me].



