APIs
Index
Home
API Design Best Practices
API Design Best Practices
- What does REST stand for? -Representational State Transfer
- REST APIs are designed around a __.
- Resources, which are any kind of object, data, or service that can be accessed by the client.
- What is an identifier of a resource? Give an example.
- for example domain.com/projects Projects is the identifier here and it gives implied meaning to what you will find on said page.
- What are the most common HTTP verbs?
- GET
- POST
- PUT
- PATCH
- DELETE
- What should the URIs be based on?
- URIs should be based on nouns (the resource) and not verbs (the operations on the resource).
- Give an example of a good URI.
- domain.com/collection
- What does it mean to have a ‘chatty’ web API? Is this a good or a bad thing?
- Avoid “chatty” web APIs that expose a large number of small resources. Such an API may require a client application to send multiple requests to find all of the data that it requires. Instead, you might want to denormalize the data and combine related information into bigger resources that can be retrieved with a single request.
- What status code does a successful
GETrequest return?- HTTP status code 200 (OK).
- What status code does an unsuccessful
GETrequest return?- 404 (Not Found).
- What status code does a successful
POSTrequest return?- HTTP status code 201 (Created).
- What status code does a successful
DELETErequest return?- HTTP status code 204 (No Content)