You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 14, 2018. It is now read-only.
In MVC there is an explicit overload for HttpNotFound on controller that takes a string with the status description. That ends up generating an error page that displays the status description to the user.
Currently we don't have that overload. We should consider bringing it back as:
It makes it easier to legacy applications into vNext as it improves back compat.
It makes it easier (even possible in some cases) to troubleshot you application (For example, how do you troubleshot a 404 when your service is behind a non transparent proxy).
It provides a very basic way of returning an error that can be displayed on the browser, with little chance for failure except for a closed connection or similar failure.
It more accurately aligns with the HTTP protocol that says the following about 4xx results: The 4xx class of status code is intended for cases in which the client seems to have erred. Except when responding to a HEAD request, the server SHOULD include an entity containing an explanation of the error situation, and whether it is a temporary or permanent condition. These status codes are applicable to any request method. User agents SHOULD display any included entity to the user.
The text was updated successfully, but these errors were encountered:
I suggest we just make NotFound(object) overload available on Controller. It will return ObjectResult with the status code. We can also just fork inside the method of the object is null to just return HttpNotFound
Create an NotFoundObjectResult similar to BadRequestObjectResult and an overload in controller.cs. @rynowak is there a reason we didn't include this as part of the last cleanup of action results?
In MVC there is an explicit overload for HttpNotFound on controller that takes a string with the status description. That ends up generating an error page that displays the status description to the user.
Currently we don't have that overload. We should consider bringing it back as:
The text was updated successfully, but these errors were encountered: