5

Do you guys return 200 when a search function in your API returns a not found and you attach a response in the object saying "success: false", or do you return 404? I'm confused. Thanks.

https://softwareengineering.stackexchange.com/...

Comments
  • 4
    @rantalicious agreed - empty result is in fact successful
    So 200 and even success:true, but data:[]
    ;)
  • 1
    Thanks, guys.
  • 4
    2xx: you submitted a valid request, here is the result.
    4xx: you fucked up
    5xx: I fucked up

    A search returning 0 results is not a “You fucked up” scenario, at least not within the context of a search request.
Add Comment