Question : asp.net c# return 500 status code with body
Answered by : adam-4zcxj3s7oreq
return StatusCode(StatusCodes.Status500InternalServerError, responseObject);
Source : | Last Update : Tue, 25 Oct 22
Question : asp.net return 500 status code
Answered by : adam-4zcxj3s7oreq
[HttpPost]
public IActionResult Post([FromBody] string something)
{ //... try { DoSomething(); } catch(Exception e) { LogException(e); return StatusCode(500); }
}
Source : | Last Update : Tue, 25 Oct 22