CRUD Assignment 1. Create a new API Endpoint that can fetch all books from a specific author using either Path Parameters or Query Parameters. Code and Result: As async is implemented by FastAPI itself hence ignored it. from fastapi import FastAPI app = FastAPI () BOOKS = [ { "title" : "Book One" , "author" : "Author A" , "category" : "Fiction" }, { "title" : "Book Two" , "author" : "Author B" , "category" : "Non-Fiction" }, { "title" : "Book Three" , "author" : "Author A" , "category" : "Biography" }, { "title" : "Book Four" , "author" : "Author A" , "category" : "Historical" }, { "title" : "Book Five" , "author" : "Author A" , "category" : "Romanc...
Comments
Post a Comment