Todo API
Description A simple CRUD API for managing Todos.
Installation
- Clone the repository.
- Install dependencies with
pip install -r requirements.txt
.
Usage
-
GET /todos:
- Description: Retrieve all todos.
- Response:
- Status Code: 200 OK
- Body: JSON object with an array of todos.
-
GET /todos/{todo_id}:
- Description: Retrieve a specific todo.
- Parameters:
todo_id
: ID of the todo to retrieve.
- Response:
- Status Code: 200 OK
- Body: JSON object with the todo.
- Status Code: 404 Not Found (if todo with given ID is not found).
-
POST /todos:
- Description: Create a new todo.
- Request:
- Method: POST
- Headers: Content-Type: application/json
- Body: JSON object with the
task
field.
- Response:
- Status Code: 201 Created
- Body: JSON object with the newly created todo.
- Status Code: 400 Bad Request (if request body is invalid).
-
PUT /todos/{todo_id}:
- Description: Update a todo.
- Parameters:
todo_id
: ID of the todo to update.
- Request:
- Method: PUT
- Headers: Content-Type: application/json
- Body: JSON object with the updated
task
.
- Response:
- Status Code: 200 OK
- Body: JSON object with the updated todo.
- Status Code: 404 Not Found (if todo with given ID is not found).
- Status Code: 400 Bad Request (if request body is invalid).
-
DELETE /todos/{todo_id}:
- Description: Delete a todo.
- Parameters:
todo_id
: ID of the todo to delete.
- Response:
- Status Code: 200 OK
- Body: JSON object indicating the success of deletion.
- Status Code: 404 Not Found (if todo with given ID is not found).
Contributing Feel free to contribute by opening issues or creating pull requests.
License This project is licensed under the MIT License - see the LICENSE.md file for details.
Contact For any questions or suggestions, contact [Your Name] at [your.email@example.com].