Quantcast
Channel: Active questions tagged rest - Stack Overflow
Viewing all articles
Browse latest Browse all 4110

What status code we should return when request is correct but there is no data for the specific user?

$
0
0

I have an endpoint that return some live data for specific user (GET). And in most of the cases there is live data for most of the users, so I return the json body and 200 status code, but in some cases the request is successful but there is just no data in Redis. What status code should I return in this case? (From my opinion is 204 NoContext, but it cannot contain a body, so I was also thinking about 404, but it make less sense, cause theoretically there is no error).

So what is the right status code should be returned in this case, regarding REST?


Viewing all articles
Browse latest Browse all 4110

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>