-
Notifications
You must be signed in to change notification settings - Fork 1
REST
Fernando Benjamin edited this page Jan 14, 2020
·
3 revisions
| HTTP Method | Idempotent | Safe |
|---|---|---|
| OPTIONS | yes | yes |
| GET | yes | yes |
| HEAD | yes | yes |
| PUT | yes | no |
| POST | no | no |
| DELETE | yes | no |
| PATCH | no | no |
What would happen if you sent out the POST request to the server, but you get a timeout. Is the resource actually updated? Does the timeout happened during sending the request to the server, or the response to the client? Can we safely retry again, or do we need to figure out first what has happened with the resource? By using idempotent methods, we do not have to answer this question, but we can safely resend the request until we actually get a response back from the server.
- When required parameters for executing the operation succesful are missing.
- Resource was not found.
Resource - Can be a singleton or a collection like /Customersor `/Customers/{customerId}
Nouns - Identify low level resources like openan Account or closean Account.
- Use POST to create a resource identified by a service-generated URI.
- Use POST to append a resource to a collection identified by a service-generated URI.
- Use PUT to create or overwrite a resource identified by a URI computed by the client.