207 Multi-Status
Usage
A 207 Multi-Status response arrives when a single HTTP request touches multiple resources. For example, a POST request updating several databases might succeed on some and fail on others. The response body lists individual results for each resource.
By default, the body is an XML document with a multistatus root element. The client parses each node to determine the outcome of every sub-operation.
The root element contains zero or more response elements in any order. Each response includes an href element identifying the target resource. Two formats exist: the status refers either to the resource as a whole, or to specific properties of the resource.
WebDAV
The 207 Multi-Status status code is primarily used by WebDAV. Standard HTTP clients rarely encounter this response outside of WebDAV workflows.
Status of the resource as a whole
A child status element holds the resulting HTTP status code for the identified resource. Clients are expected to handle standard HTTP status codes found here.
<d:response>
<d:href>http://example.re/tasks</d:href>
<d:status>HTTP/1.1 200 OK</d:status>
</d:response>
Status of individual properties
The PROPFIND and PROPPATCH methods use propstat in place of status to report on individual properties of a resource.
<d:response>
<d:href>http://example.re/tasks</d:href>
<d:propstat>
<d:prop>
<d:getcontentlanguage>
"en-CA"
</d:getcontentlanguage>
</d:prop>
<d:status>HTTP/1.1 200 OK</d:status>
</d:propstat>
</d:response>
Success or failure indication
A 207 Multi-Status response signals overall success, overall failure, or a mix of both. The client examines each response element to assess completeness of the operation.
Example
The client posts XML data to the server. Three independent resources are involved, and the server returns individual results for each one.
The first two resources succeed: the first returns no body (204) and the second confirms a new resource was created (201). The third resource reports a 423 error because a lock is held. The client determines whether the overall operation succeeded or failed based on these individual codes.
Request
POST /signup HTTP/1.1
Host: example.com
Content-Type: application/xml
Content-Length: 93
<?xml version="1.0"?>
<person>
<name>David Smith</name>
<country>USA</country>
</person>
Response
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/signup/r1</d:href>
<d:status>HTTP/1.1 204 No Content</d:status>
</d:response>
<d:response>
<d:href>http://example.re/signup/r2</d:href>
<d:status>HTTP/1.1 201 Created</d:status>
</d:response>
<d:response>
<d:href>http://example.re/signup/r3</d:href>
<d:status>HTTP/1.1 423 Locked</d:status>
<d:error><d:lock-token-submitted/></d:error>
</d:response>
</d:multistatus>
Code references
.NET
HttpStatusCode.MultiStatus
Rust
http::StatusCode::MULTI_STATUS
Rails
:multi_status
Go
http.StatusMultiStatus
Symfony
Response::HTTP_MULTI_STATUS
Python3.5+
http.HTTPStatus.MULTI_STATUS
Apache HttpComponents Core
org.apache.hc.core5.http.HttpStatus.SC_MULTI_STATUS
Angular
@angular/common/http/HttpStatusCode.MultiStatus