APIs
API Design Best Practices
- What does REST stand for?
- representational state transfer
- REST APIs are designed around a what?
- resources (any kind of object, data, or service that can be accessed by the client)
- What is an identifer of a resource? Give an example.
- What are the most common HTTP verbs?
- GET, POST, PUT, PATCH, and DELETE.
- What should the URIs be based on?
- nouns (the resource) not verbs (operations on the resource)
- Give an example of a good URI.
- school.edu/students/account/billing
- What does it mean to have a ‘chatty’ web API?
- an api that exposes a large number of small resources
- Is this a good or a bad thing?
- bad thing bc it requires the web server to make many requests when only one would be better
- What status code does a successful GET request return?
- What status code does an unsuccessful GET request return?
- What status code does a successful POST request return?
- What status code does a successful DELETE request return?