207 Multi-Status
Conveys information about multiple resources in situations where multiple status codes might be appropriate.
Usually happens because:
- ☑ WebDAV directory listing or properties
🔍 Quick Checklist:
Meaning
The HTTP 207 Multi-Status WebDAV status code conveys information about multiple resources in situations where multiple status codes might be appropriate. The response body is an XML payload containing individual status reports for each sub-resource request.
Root Causes
- WebDAV directory listing or properties requests (PROPFIND/PROPPATCH) returning status info for multiple files.
| Cause | Frequency |
|---|---|
| WebDAV directory listing or properties | ⭐⭐⭐⭐⭐ |
Common Mistakes
- Returning a single 200 OK status code but failed item results are embedded inside the XML body.
- Misconfiguring xml mime types resulting in client parsing errors.
How to Fix
Framework-Specific Examples
Returning 207 Multi-Status XML responses in Express controllers.
app.propfind('/documents', (req, res) => {
res.status(207).set('Content-Type', 'text/xml').send('<multistatus></multistatus>');
});Server Configuration Examples
Allowing WebDAV protocol configurations.
dav_methods PUT DELETE MKCOL COPY MOVE;Prevention
- Use XML mapping libraries to generate structured node trees.
- Always set Content-Type header to text/xml or application/xml.
Frequently Asked Questions (FAQ)
Q: Is 207 Multi-Status used in REST APIs?
Normally no. It is an extension defined by WebDAV (RFC 4918). However, some batch processing REST API designs use it to return status results for arrays of items uploaded at once.
Q: What format is the 207 response body?
The body is typically formatted in XML using WebDAV namespaces (multistatus, response, href, status).
Q: Can a 207 response contain both 2xx and 4xx status items?
Yes. Each sub-element carries its own status code (e.g. file1.txt succeeded with 200, file2.txt failed with 403).
Q: Should I use 207 for bulk uploads?
It is a valid approach, though returning a simple JSON array with status codes (e.g. {results: [{status: 200}, {status: 400}]}) is more common in modern APIs.