HTTP

HTTP 204 No Content vs 226 IM Used

Both HTTP 204 (No Content) and 226 (IM Used) belong to the 2xx Success category. 204 indicates that the server successfully processed the request but is not returning any content. Common for DELETE operations and form submissions that don't need a response body. Meanwhile, 226 means that the server has fulfilled a GET request for the resource, and the response is a representation of the result of one or more instance-manipulations.

설명

The server successfully processed the request but is not returning any content. Common for DELETE operations and form submissions that don't need a response body.

이 코드를 보게 되는 경우

After DELETE requests, PUT updates where no body is needed, or CORS preflight responses.

해결 방법

No fix needed. The action was successful; there is simply no content to return.

설명

The server has fulfilled a GET request for the resource, and the response is a representation of the result of one or more instance-manipulations.

이 코드를 보게 되는 경우

When using delta encoding to reduce bandwidth.

해결 방법

Rarely encountered. The response uses Instance Manipulations (IM) as specified.

주요 차이점

1.

HTTP 204: The server successfully processed the request but is not returning any content. Common for DELETE operations and form submissions that don't need a response body.

2.

HTTP 226: The server has fulfilled a GET request for the resource, and the response is a representation of the result of one or more instance-manipulations.

3.

You encounter 204 when after DELETE requests, PUT updates where no body is needed, or CORS preflight responses.

4.

You encounter 226 when when using delta encoding to reduce bandwidth.

언제 어떤 것을 사용할지

For 204 (No Content): No fix needed. The action was successful; there is simply no content to return. For 226 (IM Used): Rarely encountered. The response uses Instance Manipulations (IM) as specified.

더 알아보기