# Simple API Demo using Flask
Restfull API using Python with Flask as a framework
run this command on terminal to install Flask
pip install flaskand run the project with command
python app.pyThe server will start running at http://127.0.0.1:5000/.
- GET /books - Retrieve a list of all books.
http://127.0.0.1:5000/books
- GET /books/ - Retrieve a specific book by ID.
http://127.0.0.1:5000/books/<id>
- POST /books - Create a new book.
bash http://127.0.0.1:5000/books
Under the Body tab, select raw and choose JSON from the dropdown. Enter the user data as JSON, for example:
{
"title": "Negeri Para Bedebah",
"author": "Tere Liye",
"year": 2021
}- PUT /books/ - Update an existing book by ID.
- DELETE /books/ - Delete a book by ID.