(search by title only, search for books where the title contains "OData")
Example 3: GET /api/books/search/*/Doe
(search by author only, search for books where the author's name contains "Doe")
http://localhost:5000/api/Books/search/harry/%2A
Server response.
Details
Code
200
Response body
{
"bookId": 2,
"title": "Harry Potter and the Philosopher's Stone",
"authors": [
{
"authorId": 2,
"name": "J.K. Rowling",
"bio": "British author, best known for the Harry Potter series."
"authorId": 3,
"name": "J.R.R. Tolkien",
"bio": "English writer, poet, philologist, and academic."
1,
"publisher": "Bloomsbury",
"publicationYear": 1997
"bookId": 7,
"title": "Harry Potter and the Chamber of Secrets",
Figure 4- API to search for books where the title contains the string 'harry' and the author is not relevant ('%2A' represents the '*').
3.API to delete a book (using method DELETE)
Create an API to delete a book from the library by its Bookld. See Figure 3.
If the specified Bookld is not found in the database, the API should return a 404 Not Found response.
Zoom
+ 100%
Close