Custom Reason Phrase in ASP.NET Web API Controller Action

The source code for this post can be found at https://github.com/DmitryZinchenko/blog-WrappedHttpActionResult .

So, you are in the middle of your iteration or heavy refactoring. The API documentation is not ready yet but you deployed your ASP.NET Web API application (Release build) to remote server for dev testing. Your UX teammates started using it periodically checking browser’s Developer Tools Network tab.

As long as they see 200 OK or 404 Not Found – everything is clear and fine. But once in a while you get 400 Bad Request and 500 Internal Server Error and you wish you could get a hint what have caused it.

Continue reading “Custom Reason Phrase in ASP.NET Web API Controller Action”

Custom Reason Phrase in ASP.NET Web API Controller Action