mirror of https://github.com/mickael-menu/zk
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
390 B
Markdown
15 lines
390 B
Markdown
3 years ago
|
---
|
||
|
date: 2011-05-16 09:58:57
|
||
|
keywords: [programming, http]
|
||
|
category: "Best practice"
|
||
|
---
|
||
|
|
||
|
# When to prefer PUT over POST HTTP method?
|
||
|
|
||
|
`PUT` should be idempotent. This means that it's harmless to call a `PUT` request many times. On the contrary, calling `POST` requests repeatedly might change data on the server again.
|
||
|
|
||
|
A way to see it is:
|
||
|
|
||
|
* `PUT` = SQL `UPDATE`
|
||
|
* `POST` = SQL `INSERT`
|