API - Common-Practices-For-Rest-Api-Development
API - Common-Practices-For-Rest-Api-Development
Accept and respond with JSON Allow filtering, sorting & pagination
JSON is the standard for transferring data. Almost every networked A database behind a REST API can be very big and that means that
technology can use it: JavaScript has built-in methods to encode and it's not always a good idea to return everything to the client, because
decode JSON either through the Fetch API or another HTTP client. it may slow down the system. In these cases we must offer the client
Server-side technologies have libraries that can decode JSON some filtering options based on what he specifically wants.
without doing much work. Filtering and also pagination grows the performance of your REST
To make sure that when our REST API app responds with JSON that API because it doesn't make the system to compile the entire
clients interpret it as such, we should set Content-Typein the database of resources in the response.
Example(s):
and /api/books
/api/book/{id}
and /api/accounts
/api/account/{id}
and /api/persons
/api/person/{id}
Example:
https://appgateway.lidlplus.com/app/‐
v19/RO/tickets/list/ where v19 shows the version
number.