REST Flashcards

1
Q

What does the acronym REST stand for? What makes a service “RESTful”?

A

Representational State Transfer

It’s an architectural style for providing standards between computer systems on the web and makes it easier for systems to communicate with each other. A service is RESTful when it’s stateless, cacheable, has a uniform interface, client-server architecture, and a layered system.

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

What protocols and data format do REST services use?

A

Http protocols. REST services use JSON, XML and a variety of other data formats.

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

What are the architectural constraints of REST?

A

Uniform interface, client-server, stateless, cacheable, layered system

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

Uniform Interface (Constraint)

A

Be consistent in naming endpoints. Leverage http protocol for interacting with our api.

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

Client-server (Constraint)

A

Client and server must be able to evolve separately from one another. Client only needs to know URIs to resources exposed by the api

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

Stateless (Constraint)

A

The server will not store anything about the client’s request. Every request is a new request from the api perspective.

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

Cacheable (Constraint)

A

Resources that will not change should be cached to decrease latency of retrieval of frequently accessed resources.

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

Layered System (Constraint)

A

Different domains of the application are physically and logically separate from each other

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

Explain the levels of the Richardson Maturity Model

A

Level 0 - services have a single URI and a single HTTP method
Level 1 - services have many URIs but only a single HTTP method
Level 2 (most popular) - services have many URIs and support several CRUD services
Level 3 - makes use of URIs, HTTP, and HATEOAS

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

Explain the HATEOAS concept

A

Hypermedia As The Engine Of Application State

Keeps the REST style architecture unique from other network application architectures.

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

What is a “resource” in a REST service?

A

Any information that can be named. Similar to an entity in a database.

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

How would you implement authentication/authorization in a RESTful web service while maintaining statelessness?

A

You could use tokens to allow access to a specific service or resource without using credentials to authenticate every request so nothing is stored during the authentication request.

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