1

I have a controller, which is accepting a list of Ids as query string (csv).

I am splitting the string , creating an array and then loop through each item.

For each item, I am making a service call and if found adding them to response list.

Now, the issue with this approach, if user has passed an id , which is not present , then there are no indication to user.

I can go ahead and write some code when item is null.

What I am intrested to know , now do we handle this from a frame work level.

Its not a 404 or 206, but a 200 with few possible 204.

Just wanted to know how to handle this use case.

Simsons
  • 12,295
  • 42
  • 153
  • 269
  • 1
    Does [this answer](https://stackoverflow.com/questions/51999814/http-status-code-for-empty-response-and-response-not-found) help you? 404s are only helpful when requesting a single resource, but for many - it is from my experience best to return 200 with an empty list or just explicit map the ids to null. – thinkgruen May 05 '22 at 09:21

0 Answers0