Volume 2 - Chapter 23: Understanding REST and JSON Flashcards

1
Q

What are the 6 attributes of a REST-Based (RESTful) API?

A
  1. Client/Server architecture
  2. Stateless operation
  3. Client statement of cacheable/uncacheable
  4. Uniform interface
  5. Layered
  6. Code-on-demand
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

True or False:

HTTP is required for an API to be considered RESTful.

A

False; while HTTP/HTTPS is common, it is not a requirement for an API to be considered RESTful.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Describe how the client/server model functions with a RESTful API.

A
  1. A REST client makes an API REST call to the REST server
  2. The REST server returns a response to the client
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Describe how a stateless operation works with a RESTful API.

A

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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How does the function of “cacheable/uncacheable” content fit in with RESTful APIs?

A
  1. REST APIs must clearly mark content as cacheable or uncacheable
  2. If cacheable, a clear timer must be established for when the content needs to be downloaded again
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

In regards to Python and other scripting languages, describe the difference between a list and a dictionary.

A

A list is a list of multiple values

A dictionary is a list of matching key:value pairs

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

The following diagram is an example of a ____.

A

Dictionary, that contains multiple key:value pairs.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

The following diagram is an example of a ____.

A

List

How well did you know this?
1
Not at all
2
3
4
5
Perfectly