More specific 404 errors

Hey there,

Is there some standard way of the following:

  • client sends you a request with and id
  • look it up and it is not found
  • this will fail the validation of the struct and the fallback controller will return a 404 to the client

Question is can we tell the client that what was not found, if so how?

Thank you

You can return whatever content (error or otherwise) you want in the HTTP response body.

Just be careful to recognise that if you provide too much information you are potentially arming a bad actor with ideas about how to try exploit your system.

2 Likes