This API must support filtering, sorting, and pagination using OData query options like $filter, $orderby, $top, and $skip.
URL: [GET]/api/books
Example
request: [GET]
/api/books?$filter=Author eq
'John
Doe'&$orderby=Publication Year desc&$top=10
Request URL
http://localhost:5000/api/Books
Server response
Code
200
Details
Response body
[
{ "bookId": 1,
"title": "1984",
"authors": [
{
"authorId": 1,
"name": "George Orwell",
"bio": "English novelist and essayist, journalist and critic."
"authorId": 3,
"name": "J.R.R. Tolkien",
"bio": "English writer, poet, philologist, and academic."
}
],
"publisher": "Secker & Warburg",
"publicationYear": 1949
"bookId": 2,
"title": "Harry Potter Philosopher's Stone"
Figure 3-The API to list all books.
2.API to search or filter books (using method GET)
Zoom
+ 100%
Close