Volume 2 - Chapter 23: Understanding REST and JSON Flashcards
What are the 6 attributes of a REST-Based (RESTful) API?
- Client/Server architecture
- Stateless operation
- Client statement of cacheable/uncacheable
- Uniform interface
- Layered
- Code-on-demand
True or False:
HTTP is required for an API to be considered RESTful.
False; while HTTP/HTTPS is common, it is not a requirement for an API to be considered RESTful.
Describe how the client/server model functions with a RESTful API.
- A REST client makes an API REST call to the REST server
- The REST server returns a response to the client
Describe how a stateless operation works with a RESTful API.
APIs that are considered RESTful are stateless; they do not track or keep information about previous API calls or request.
REST servers do not make decisions based on previous requests.
How does the function of “cacheable/uncacheable” content fit in with RESTful APIs?
- REST APIs must clearly mark content as cacheable or uncacheable
- If cacheable, a clear timer must be established for when the content needs to be downloaded again
In regards to Python and other scripting languages, describe the difference between a list and a dictionary.
A list is a list of multiple values
A dictionary is a list of matching key:value pairs
The following diagram is an example of a ____.
Dictionary, that contains multiple key:value pairs.
The following diagram is an example of a ____.
List