REST Flashcards Preview

OCA Summary > REST > Flashcards

Flashcards in REST Deck (8)
Loading flashcards...
1
Q

HTTP

GET

A

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

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

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

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

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

6
Q

HTTP

PATCH

A

Partial modification to the specified resources

Not Safe Operator:

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

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)