I have a Web API controller POST method that behaves fine locally and on the testing server. If everything goes well it returns:
new HttpResponseMessage( Htt
Had the same issue. It's indeed because of the custom errors setting.
In a real world scenario, you would definitely want to use a custom error page in your application, but in order for custom exception messages to work in the WebAPI you need to disable the custom errors page.
How to fix this? Luckily, you can use the
element in your web.config to solve this.
Solution:
I use this method in my own app, works well.