-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
46 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,64 @@ | ||
--- | ||
title: 409 Conflict | ||
slug: Web/HTTP/Status/409 | ||
l10n: | ||
sourceCommit: ba53fe04589c36a2210d7549c003f3016093ef8e | ||
--- | ||
|
||
{{HTTPSidebar}} | ||
|
||
HTTP **`409 Conflict`** はリクエストが現在のサーバーの状態と競合したことを示すステータスコード。 | ||
HTTP **`409 Conflict`** は[クライアントエラーレスポンス](/ja/docs/Web/HTTP/Status#成功レスポンス)のステータスコードで、リクエストが現在のサーバーの状態と競合したことを示します。 | ||
|
||
競合は {{HTTPMethod("PUT")}} メソッドを使用したリクエストのレスポンスで最も発生しやすい。例えば、サーバーにすでに存在しているファイルよりも古いバージョンのファイルをアップロードした際に 409 の応答が返され、バージョン管理システムの競合が発生する可能性がある。 | ||
{{glossary("WebDAV")}} のリモートウェブオーサリングでは、 `409 conflict` レスポンスはクライアントに送信されるエラーであり、ユーザーが競合を解決してリクエストを再送信できるようにするためのものです。 | ||
例えば、 `/a/b/c/d/` という集合を作成するリクエストが行われ、 `/a/b/c/` が存在しない場合、リクエストは 409 で失敗しなければなりません。 | ||
また、サーバー上の既存のファイルよりも古いファイルをアップロードした場合にも 409 レスポンスが返されることがあり、バージョン制御の競合が発生します。 | ||
|
||
他にも、実装固有の目的で 409 レスポンスが使用される場合があります。例えば、サーバーが同じリソースを更新する複数のリクエストを受け取ったことを示す場合などです。 | ||
|
||
## ステータス | ||
|
||
``` | ||
```http | ||
409 Conflict | ||
``` | ||
|
||
## 仕様 | ||
## 例 | ||
|
||
### 許可されていない同時進行のタスク | ||
|
||
次の例では、システムで一般的なタスクを実行する自動化プロセスを開始したいと考えています。 | ||
|
||
```http | ||
POST /tasks HTTP/1.1 | ||
Host: example.com | ||
Content-Type: application/json | ||
{ | ||
"task": "emailDogOwners", | ||
"template": "pickup" | ||
} | ||
``` | ||
|
||
この実装では、サーバーは 2 つの同時ジョブの実行を拒否し、 409 を返します。これにより、クライアントは、そのアクションを実行する、あるいは別のタスクを実行するという意味なのかどうかを調べる機会が提供されます。 | ||
|
||
```http | ||
HTTP/1.1 409 Conflict | ||
Date: Wed, 26 Jun 2024 12:00:00 GMT | ||
Server: Apache/2.4.1 (Unix) | ||
Content-Type: application/json | ||
{ | ||
"code": "AutomationConflict", | ||
"task": "emailDogOwners", | ||
"message": "Task locked. Cannot start a new automation since job is already running.", | ||
"runningTaskId": "123" | ||
} | ||
``` | ||
|
||
## 仕様書 | ||
|
||
| 仕様書 | タイトル | | ||
| ----------------------------------------- | ------------------------------------------------------------- | | ||
| {{RFC("7231", "409 Conflict" , "6.5.8")}} | Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content | | ||
{{Specifications}} | ||
|
||
## 参照 | ||
## 関連情報 | ||
|
||
- [HTTP レスポンスステータスコード](/ja/docs/Web/HTTP/Status) | ||
- {{HTTPMethod("PUT")}} |