HTTPQUERY
Bahasa Indonesia

208 Already Reported

Penggunaan

Ketika klien menerima 208 Already Reported di dalam body multi-status 207, sumber daya tersebut sudah dijabarkan sebelumnya pada respons yang sama. Tidak ada detail tambahan yang diberikan untuk entri ganda tersebut.

Kode status ini hadir khusus untuk WebDAV Binding Extensions. Sebuah sumber daya yang terikat ke beberapa lokasi di dalam koleksi yang sama muncul sekali secara lengkap dan sekali sebagai 208 Already Reported, sehingga memutus potensi rekursi ketika permintaan Depth: infinity menemui sumber daya yang mereferensikan dirinya sendiri.

Hanya WebDAV

Kode status 208 Already Reported muncul secara eksklusif di dalam body respons multi-status 207. Server tidak pernah mengirim 208 sebagai status respons HTTP tingkat atas.

Contoh

Klien mengirim permintaan PROPFIND dengan Depth: infinity untuk menelusuri koleksi /main/. Sumber daya /main/dependent terikat ke sumber daya dasar yang sama dengan /main/ itu sendiri.

Server mengembalikan detail lengkap untuk /main/ terlebih dahulu, lalu mengembalikan 208 Already Reported untuk /main/dependent guna memutus loop rekursif.

Permintaan

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>

Respons

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>

Referensi kode

.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