HTTP Status 204 vs 404 (2024)

Table of Contents
Conclusion References
HTTP Status 204 vs 404 (2)

The HTTP Status 204 means that it’s a successful request, but doesn’t have a response body, while the 404 means the resource doesn’t exist.

In the RFC5789 — HTTP PATCH we find that:

Resource not found: Can be specified with a 404 (Not Found) status code when the client attempted to apply a patch document to a non-existent resource, but the patch document chosen cannot be applied to a non-existent resource.

In the book REST API — Design Rulebook by Mark Masse we find that:

Once a DELETE request has been processed for a given resource, the resource can no longer be found by clients. Therefore, any future attempt to retrieve the resource’s state representation, using either GET or HEAD, must result in a 404 (“Not Found”) status returned by the API.

The Azure API has this recommendation:

“DO return a 204-No Content without a resource/body for a DELETE operation (even if the URL identifies a resource that does not exist; do not return 404-Not Found)”

Conclusion

The 204 is usually used when there is no content to return, when the resource is not found usually the 404 should be returned. Usually, the 404 is not used for the DELETE operation, as it is an idempotent method. However, it is used in the case of PATCH, GET, or HEAD operations.

In the end, the most important thing is to define a guideline and align it with the team that will use it. The key here is having a common pattern and sticking to it.

If you are interested in staying up-to-date with software development-related news, please subscribe to our newsletter: https://devjava.substack.com/

References

REST API — Design Rulebook — Mark Masse

AZURE API Guidelines

HTTP Status 204 vs 404 (2024)
Top Articles
Main Cabin vs. Basic Economy: How to Pick the Best Fare for Your Trip
China Corporate Presence and Investment in the US
$4,500,000 - 645 Matanzas CT, Fort Myers Beach, FL, 33931, William Raveis Real Estate, Mortgage, and Insurance
Fernald Gun And Knife Show
Ups Customer Center Locations
Kansas City Kansas Public Schools Educational Audiology Externship in Kansas City, KS for KCK public Schools
Pinellas County Jail Mugshots 2023
Booknet.com Contract Marriage 2
The Potter Enterprise from Coudersport, Pennsylvania
Konkurrenz für Kioske: 7-Eleven will Minisupermärkte in Deutschland etablieren
Doby's Funeral Home Obituaries
Lantana Blocc Compton Crips
Facebook Marketplace Charlottesville
Charmeck Arrest Inquiry
3472542504
6001 Canadian Ct Orlando Fl
Dexter Gomovies
Cvs Appointment For Booster Shot
Quest Beyondtrustcloud.com
Payment and Ticket Options | Greyhound
Highland Park, Los Angeles, Neighborhood Guide
Dtab Customs
Nhl Tankathon Mock Draft
Wsop Hunters Club
Timeforce Choctaw
Www Va Lottery Com Result
Accuweather Minneapolis Radar
Southwest Flight 238
Timeline of the September 11 Attacks
Beaufort 72 Hour
Ullu Coupon Code
Winterset Rants And Raves
R/Mp5
L'alternativa - co*cktail Bar On The Pier
Minecraft Jar Google Drive
What Time Does Walmart Auto Center Open
Why The Boogeyman Is Rated PG-13
Babylon 2022 Showtimes Near Cinemark Downey And Xd
Troy Gamefarm Prices
Cox Outage in Bentonville, Arkansas
Busch Gardens Wait Times
Callie Gullickson Eye Patches
How to Install JDownloader 2 on Your Synology NAS
26 Best & Fun Things to Do in Saginaw (MI)
Lorton Transfer Station
Latina Webcam Lesbian
Bismarck Mandan Mugshots
Hampton Inn Corbin Ky Bed Bugs
Ubg98.Github.io Unblocked
Fetllife Com
Latest Posts
Article information

Author: Edwin Metz

Last Updated:

Views: 5853

Rating: 4.8 / 5 (78 voted)

Reviews: 93% of readers found this page helpful

Author information

Name: Edwin Metz

Birthday: 1997-04-16

Address: 51593 Leanne Light, Kuphalmouth, DE 50012-5183

Phone: +639107620957

Job: Corporate Banking Technician

Hobby: Reading, scrapbook, role-playing games, Fishing, Fishing, Scuba diving, Beekeeping

Introduction: My name is Edwin Metz, I am a fair, energetic, helpful, brave, outstanding, nice, helpful person who loves writing and wants to share my knowledge and understanding with you.