You are building a RESTful API using ASP.NET Core. In a scenario where the resource is not found, which action result should you use to represent this state?

  • NotFound
  • BadRequest
  • Ok
  • InternalServerError
In ASP.NET Core, the NotFound action result is used to represent a situation where the requested resource is not found. It returns an HTTP 404 status code, indicating that the resource could not be located. This is the appropriate response for this scenario.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *