This web API action returns an HTTP 500 status code (Internal Server Error):
public IHttpActionResult Post() { return InternalServerError(); }
But this action returns an HTTP 400 status code (Bad Request):
public IHttpActionResult Post() { return InternalServerError(new Exception()); }
I would expect both actions to return a 500 status code, and the second action will add some error details to the response body.
My first thought is that this is a mistake, but I wanted to get a different input. Is there a good reason why 400 should be returned in the second action instead of 500?
UPDATE:
The documentation for this method reads:
Creates a System.Web.Http.Results.ExceptionResult (500 Internal Server Error) with the specified exception.
I think this is a mistake more and more.
jebar8
source share