Takeaways
NoteThe 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.
- A
207 Multi-Status
response conveys information about multiple resources in situations where multiple status codes might be appropriate. - The default
207 Multi-Status
response body is atext/xml
orapplication/xml
HTTP entity with amultistatus
root element. - Further elements contain
200
,300
,400
, and500
series status codes generated during the method invocation. 100
series status codes should not be recorded in aresponse
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:
- A
status
element as child of theresponse
element indicates the status of the message execution for the identified resource as a whole. - 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.
- For
PROPFIND
andPROPPATCH
, the format has been extended using thepropstat
element instead ofstatus
, providing information about individual properties of a resource.