DEV Community

Discussion on: Why some API response codes are subjective ?

Collapse
 
soumyabrata1147 profile image
Soumyabrata Bhattacharjee

I think 200 is the best status code for this.Your are getting an empty result because there is no data to show according to your search value.It is not an error.So 200 is absolutely okay.I use 200 for search results.I also set a variable named "status".So when it returns a status=1 i.e its containing at least one row and returns status=0 in case no data found.I think this will help you.😊