Overview

There might be mixture of responses.

Takeaways

Note

The ability to return a collection of resources is part of the WebDAV protocol (it may be received by web applications accessing a WebDAV server). Browsers accessing web pages will never encounter this status code.

  1. A 207 Multi-Status response conveys information about multiple resources in situations where multiple status codes might be appropriate.
  2. The default 207 Multi-Status response body is a text/xml or application/xml HTTP entity with a multistatus root element.
  3. Further elements contain 200, 300, 400, and 500 series status codes generated during the method invocation.
  4. 100 series status codes should not be recorded in a response XML element.

Example

HTTP/1.1 207 Multi-Status
Content-Type: application/xml; charset="utf-8"
Content-Length: 1241
<?xml version="1.0" encoding="utf-8" ?>
<D:multistatus xmlns:D="DAV:">
  <D:response>
    <D:href>http://www.example.com/Coll/</D:href>
    <D:propstat>
      <D:prop>
        <D:displayname>Loop Demo</D:displayname>
        <D:resource-id>
          <D:href>urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf8</D:href>
        </D:resource-id>
      </D:prop>
      <D:status>HTTP/1.1 200 OK</D:status>
    </D:propstat>
  </D:response>
  <D:response>
    <D:href>http://www.example.com/Coll/Bar</D:href>
    <D:propstat>
      <D:prop>
        <D:displayname>Loop Demo</D:displayname>
        <D:resource-id>
          <D:href>urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf8</D:href>
        </D:resource-id>
      </D:prop>
      <D:status>HTTP/1.1 208 Already Reported</D:status>
    </D:propstat>
  </D:response>
</D:multistatus>

Information

Although 207 is used as the overall response status code, the recipient needs to consult the contents of the multistatus response body for further information about the success or failure of the method execution. The response may be used in success, partial success and also in failure situations.

The multistatus root element holds zero or more response elements in any order, each with information about an individual resource. Each response element must have an href element to identify the resource.

A 207 Multi-Status response uses one out of two distinct formats for representing the status:

  1. A status element as child of the response element indicates the status of the message execution for the identified resource as a whole.
  2. Some method definitions provide information about specific status codes clients should be prepared to see in a response. However, clients must be able to handle other status codes.
  3. For PROPFIND and PROPPATCH, the format has been extended using the propstat element instead of status, providing information about individual properties of a resource.

Related

Further Reading

Specification

207 Multi-Status | The HTTP Working Group

207 Multi-Status

MDN web docs

Web Distributed Authoring and Versioning (WebDAV)

MDN web docs