The HTTP status code 208 Already Reported
is a WebDAV-specific status code that indicates that the results of a DAV:binding
operation have already been included in a previous response to the same request. This status code is used to avoid listing the same resource multiple times in a response.
When is the 208 Already Reported Status Code Used?
The 208 Already Reported
status code is used in WebDAV, an extension of HTTP that allows clients to perform remote web content authoring operations. This status code is specifically used in the context of a DAV:binding
operation, which is a way to create multiple URIs (Uniform Resource Identifiers) for the same resource.
When a client requests a list of resources and their bindings, the server might encounter the same resource bound to multiple URIs. To avoid listing the same resource multiple times in the response, the server can use the 208 Already Reported
status code to indicate that a specific resource has already been included in the response.
Example of a Request and Response with 208 Already Reported
Let’s take a look at an example of a request and response that utilizes the 208 Already Reported
status code.
Request
A client sends a PROPFIND
request to retrieve the properties of all resources in a collection, including their bindings:
PROPFIND /collection HTTP/1.1
Host: example.com
Depth: 1
Content-Type: application/xml; charset="utf-8"
Content-Length: 133
<?xml version="1.0" encoding="utf-8" ?>
<D:propfind xmlns:D="DAV:">
<D:prop>
<D:displayname/>
<D:resourcetype/>
</D:prop>
</D:propfind>
Response
The server responds with a 207 Multi-Status
response, including the 208 Already Reported
status code for a resource that has already been included in the response:
HTTP/1.1 207 Multi-Status
Content-Type: application/xml; charset="utf-8"
Content-Length: 537
<?xml version="1.0" encoding="utf-8" ?>
<D:multistatus xmlns:D="DAV:">
<D:response>
<D:href>/collection/resource1</D:href>
<D:propstat>
<D:prop>
<D:displayname>Resource 1</D:displayname>
<D:resourcetype/>
</D:prop>
<D:status>HTTP/1.1 200 OK</D:status>
</D:propstat>
</D:response>
<D:response>
<D:href>/collection/resource2</D:href>
<D:status>HTTP/1.1 208 Already Reported</D:status>
</D:response>
</D:multistatus>
In this example, the server has included the properties of resource1
in the response with a 200 OK
status. However, resource2
is a binding to the same resource as resource1
, so the server uses the 208 Already Reported
status code to indicate that the properties of this resource have already been included in the response.
Summary
The 208 Already Reported
status code is a WebDAV-specific status code that helps to avoid listing the same resource multiple times in a response when the resource is bound to multiple URIs. This status code is used in conjunction with the 207 Multi-Status
response to indicate that the properties of a resource have already been included in a previous part of the response.