HTTP

HTTP 207 Multi-Status vs 304 Not Modified

HTTP 207 (Multi-Status) is a 2xx Success response, while 304 (Not Modified) is a 3xx Redirection response. 207 indicates that the response body contains status information for multiple resources, in situations where multiple status codes might be appropriate (WebDAV). In contrast, 304 means that the resource has not been modified since the last request. The client can use its cached copy.

คำอธิบาย

The response body contains status information for multiple resources, in situations where multiple status codes might be appropriate (WebDAV).

เมื่อคุณพบเห็น

In WebDAV operations that affect multiple resources simultaneously.

วิธีแก้ไข

Parse the XML body to check the status of each individual resource.

คำอธิบาย

The resource has not been modified since the last request. The client can use its cached copy.

เมื่อคุณพบเห็น

When the browser cache is still valid (If-None-Match / If-Modified-Since headers match).

วิธีแก้ไข

No fix needed. This saves bandwidth by confirming the cached version is still current.

ความแตกต่างหลัก

1.

207 is a 2xx Success response, while 304 is a 3xx Redirection response.

2.

HTTP 207: The response body contains status information for multiple resources, in situations where multiple status codes might be appropriate (WebDAV).

3.

HTTP 304: The resource has not been modified since the last request. The client can use its cached copy.

4.

You encounter 207 when in WebDAV operations that affect multiple resources simultaneously.

5.

You encounter 304 when when the browser cache is still valid (If-None-Match / If-Modified-Since headers match).

ควรใช้อันไหนเมื่อไร

For 207 (Multi-Status): Parse the XML body to check the status of each individual resource. For 304 (Not Modified): No fix needed. This saves bandwidth by confirming the cached version is still current.

เรียนรู้เพิ่มเติม