My team and myself are trying to decide on what Status Code to use, our API Client Generated via Swagger has a condition for 204 (No Content)
which has more meaning than a 404
in this instance.
We want to show that the response was successful but there was no Object
returned.
Let's say it's a shopping cart:
The customer clicks on the Cart and takes you to the page, the request sends to the endpoint Get//CartOrderDetails
but there is no items in the cart, we don't want it to run through the API Client's 200
path, but neither do we want it to go through the 404
path since it wasn't Not Found
.
What would you guys use in this case?
Edit: Thanks for all the responses overnight! Definitely helped put things in light, seems there will always be an argument for and against 204
. Thanks guys!
>(...)` I'm pretty sure that it would not handle 204
– Selvin Jul 19 '21 at 14:00