REST Flashcards

1
Q

What is REST

A

REST, or Representational State Transfer, structural design approach for crafting loosely attached applications using HTTP, style of web communications that creates a variety of outputs to represent a resource, such as JSON

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

Describe some common REST verbs and what their purpose is

A

Get (get one/get all), Post (new), Put(update), Delete(ya know)

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

What does the HEAD verb do?

A

returns all of the HTTP headers like get but the server cant return a message-body in the response

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

What does the OPTIONS verb do?

A

allow clients to obtain parameters and requirements for specific resources and server capabilities without taking action on the resource or requesting the resource.

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

What type of REST request is typically made when a browser navigates to a web page?

A

browser sends an HTTP GET request specifying the URL of its HTML page. The server retrieves the requested document from its file system and returns an HTTP response containing the document and an HTTP Response status code of “200 OK” (indicating success).

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

What are request headers?

A

a list of strings sent the client program to server on every HTTP request, usually invisible, contain information about the request, such as the format of data sent or expected, whether to cache information, and authentication information.

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

If you wanted to see what network traffic is going from your JavaScript app to other servers from Chrome, how would you view that?

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

What is a Status Code? Can you name some?

A

server always returns a message for every request
1XX - informational, 2XX - fine/completed, 3XX - redirect, 4XX - client error, 5XX - server error
200 OK, 401 Unauthorized(not authenticated), 403 Forbidden(like not admin), 404 not found, 500 internal server error

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

What’s the difference between SOAP and REST?

A

Simple Object Access Protocol.- protocol, can’t use REST, defines its own security.
REpresentational State Transfer - can use SOAP web services because it is a concept, inherits security measures from the underlying transport

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

What is an authorization header? How do you get one? How do you use it?

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

What is a JWT?

A

JSON Web Tokens-standard that defines a compact and self-contained way to securely transmit information between a client and a server as a JSON object

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

You are building a resume and job opportunity REST API:
What endpoint and verb would you use to list all resumes?
What endpoint and verb would you use to get a specific resume?
What endpoint and verb would you use to update a specific resume?
What endpoint and verb would you use to delete a specific resume?
What endpoint and verb would you use to get a specific job opportunity?
What endpoint and verb would you use to add a candidate for a specific job opportunity?

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

What is CORS and what steps do you need to take to make sure it’s not an issue?

A

Cross-Origin Resource Sharing, and is a mechanism that allows resources on a web page to be requested from another domain outside their own domain. It defines a way of how a browser and server can interact to determine whether it is safe to allow the cross-origin request.

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