Reconsider use of `DELETE` HTTP Verb where the REST API has a `remove` operation for objects
- 主要言語
- Python
- スター
- 17
- フォーク
- 2
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
**Describe the bug**
I have been using the HTTP `delete` method to remove things like card assignments from a cardholder. While this works as expected, I noticed that the `PATCH` verb supports `update`, `remove` operations which allows extra attributes like `status` where we can provide reasons for the change.
```json
"cards": {
"add": [
{
"type": {
"href": "https://localhost:8904/api/card_types/354"
},
"pin": "153624"
},
{
"type": {
"href": "https://localhost:8904/api/card_types/600"
},
"number": "Jock's iPhone 8",
"status": {
"value": "Pending sign-off"
},
"invitation": {
"email": "jock@example.com"
}
}
],
"update": [
{
"href": "https://localhost:8904/api/cardholders/325/cards/97b6a24ard6d4500a9d",
"issueLevel": 2,
"until": "",
"status": {
"value": "Stolen"
},
"pin": "153624"
}
],
"remove": [
{
"href": "https://localhost:8904/api/cardholders/325/cards/77e8affe7c7e4b56",
"status": {
"value": "Lost"
}
}
]
},
```
**To Reproduce**
Not quite applicable, attempt sending the same payload via HTTP `delete` method vs http `patch`.
**Expected behavior**
- Using `DELETE` does not leave a trace
- Using `PATCH` should perform the same operation but leave an event log
**Screenshots**
NA
**Desktop (please complete the following information):**
NA
**Smartphone (please complete the following information):**
NA
**Additional context**
See REST docs.
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
評価
この issue はまだ評価されていません。