208 Already Reported
使い方
クライアントが 207 multi-status のボディ内で 208 Already Reported を受け取った場合、そのリソースは同じレスポンスの中ですでに記述されています。重複したエントリについて追加の詳細は提供されません。
このステータスコードは WebDAV の Binding Extensions のために特別に存在します。同じコレクション内で複数の場所にバインドされたリソースは、1回は完全な形で、もう1回は 208 Already Reported として現れ、Depth: infinity のリクエストが自分自身を参照するリソースに遭遇した際の再帰の可能性を断ち切ります。
WebDAV 限定
208 Already Reported ステータスコードは 207 multi-status レスポンスのボディ内にのみ現れます。サーバーが 208 をトップレベルの HTTP レスポンスステータスとして送信することはありません。
例
クライアントが /main/ コレクションを列挙するために Depth: infinity を伴う PROPFIND リクエストを送信します。/main/dependent リソースは /main/ 自身と同じ基盤リソースにバインドされています。
サーバーはまず /main/ の完全な詳細を返し、その後、再帰ループを断ち切るために /main/dependent に対して 208 Already Reported を返します。
リクエスト
PROPFIND /main/ HTTP/1.1
Host: example.com
Depth: infinity
DAV: bind
Content-Type: application/xml; charset="utf-8"
Content-Length: 139
<?xml version="1.0" encoding="utf-8" ?>
<d:propfind xmlns:d="DAV:">
<d:prop>
<d:name/>
<d:link/>
</d:prop>
</d:propfind>
レスポンス
HTTP/1.1 207 Multi-Status
Content-Type: application/xml; charset="utf-8"
Content-Length: 568
<?xml version="1.0" encoding="utf-8" ?>
<d:multistatus xmlns:d="DAV:">
<d:response>
<d:href>http://example.re/main/</d:href>
<d:propstat>
<d:prop>
<d:name>Main Resource</d:name>
<d:resource-id>
<href>urn:uuid:1234-0000</href>
</d:resource-id>
</d:prop>
<d:status>HTTP/1.1 200 OK</d:status>
</d:propstat>
</d:response>
<d:response>
<d:href>
http://example.re/main/dependent
</d:href>
<d:propstat>
<d:prop>
<d:name>Main Resource</d:name>
<d:resource-id>
<href>urn:uuid:1234-0000</href>
</d:resource-id>
</d:prop>
<d:status>
HTTP/1.1 208 Already Reported
</d:status>
</d:propstat>
</d:response>
</d:multistatus>
コードリファレンス
.NET
HttpStatusCode.AlreadyReported
Rust
http::StatusCode::ALREADY_REPORTED
Rails
:already_reported
Go
http.StatusAlreadyReported
Symfony
Response::HTTP_ALREADY_REPORTED
Python3.5+
http.HTTPStatus.ALREADY_REPORTED
Apache HttpComponents Core
org.apache.hc.core5.http.HttpStatus.SC_ALREADY_REPORTED
Angular
@angular/common/http/HttpStatusCode.AlreadyReported