In a RESTful API, endpoints (URLs) define the structure of the API and how end users access data from our application using the HTTP methods - GET, POST, PUT, DELETE.
Endpoint |
HTTP Method |
/api/book/books/:id |
GET |
Endpoint |
HTTP Method |
/api/book/books/{params} |
GET |
Optional params to filter the list of books
Param |
Type |
Description |
name |
string |
the title name of the book |
publication_year |
number |
year the book was published |
edition |
number |
the book edition |
authors |
string |
author's name |
Endpoint |
HTTP Method |
/api/book/books |
POST |
Fields |
Type |
Description |
name |
string |
the title name of the book |
publication_year |
number |
year the book was published |
edition |
number |
the book edition |
authors |
number |
the author's id |
Endpoint |
HTTP Method |
/api/book/books/:id |
PUT |
Updatable field |
Type |
name |
string |
publication_year |
number |
edition |
number |
authors |
number |
Endpoint |
HTTP Method |
/api/author/authors |
POST |
Fields |
Type |
Description |
name |
string |
the full name of the author |
Endpoint |
HTTP Method |
/api/author/authors/:id |
GET |
Endpoint |
HTTP Method |
/api/author/authors |
GET |