REST Flashcards

1
Q

HTTP

GET

A

Use: to read data from resource
Read-only
Safe operation - does not change the state of the resource

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

HTTP

PUT

A

Use:
If not found, INSERT
if found, UPDATE

Multiple PUTs will not change the result
Likely saving a file multiple times

Not Safe operation - DOES change the state of the resource

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

HTTP

POST

A

Use: To CREATE a new object (inset)

Multiple POSTs is expected to create multiple objects

Not Safe Operation - does change the state of the resource

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

HTTP

DELETE

A

Use: To delete an object (resource)
Multiple DELETEs will have the same effect/behavior
Not Safe Operator: Does change the state of the resource

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

What do you mean by Safe Methods?

A

Because they only fetch information, do not cause changes to the server

GET
HEAD
OPTIONS
TRACE

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

HTTP

PATCH

A

Partial modification to the specified resources

Not Safe Operator:

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

Idempotence

A

Action such as repetition that have no further effect on the outcome

Example:
PUT - If you found it you update it
DELETE - you can’t delete twice

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

Is POST Idempotent?

A

No

POST is likely to create multiple objects.

When you post a form online and if refresh, they ask you if you want to repost it again.

Or when you are checking out and are asked not to refresh the page. (To avoid sending another post)

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