Quantcast
Channel: ASPNETWebStack Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 7215

Closed Unassigned: Web API 2 incorrect status code being returned from method [1437]

$
0
0
This Web API action returns an HTTP 500 (Internal Server Error) status code:

public IHttpActionResult Post()
{
return InternalServerError();
}

But this action returns an HTTP 400 (Bad Request) status code:

public IHttpActionResult Post()
{
return InternalServerError(new Exception());
}

The documentation on this method reads:

> Creates an System.Web.Http.Results.ExceptionResult (500 Internal Server Error) with the specified exception.

I would expect both actions to return a 500 status code.
Comments: Duplicate of 1318 (which has been fixed).

Viewing all articles
Browse latest Browse all 7215

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>