The HTTP 204 status code stands for "No Content". It is a successful response indicating that the server has processed the request successfully but does not return any content in the response body.

When is HTTP 204 Used?

  • Used when a request does not require a response body, but the client does not need to reload or navigate away.
  • Common in API calls, form submissions, and AJAX requests where an update occurs but no new content is needed.

Example Scenarios

  • Updating User Preferences – A user changes settings, and the server confirms the update without returning data.
  • Deleting a Resource – A request to delete a record succeeds, but no response body is needed.
  • Auto-Save in Web Apps – Saving progress without refreshing the page.

Example

Client Request (Updating User Settings)

  
    PUT /user/settings HTTP/1.1
    Host: example.com
    Content-Type: application/json

    { "dark_mode": true }
  

Server Response (No Content)

  
    HTTP/1.1 204 No Content
  

Summary

HTTP 204 means the request was processed successfully, but the server does not return any content. The client remains on the same page, and no additional action is needed.