When I try to hit invalid endpoint which contains space. Example:
http://localhost/myapiproject/api/v1/property/1234/package /5678
Server responds with complete stack trace. Example:
Server Error in '/myapiproject' Application.
The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
Requested URL: http://localhost/myapiproject/api/v1/property/1234/package /5678
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.6.1586.0
I have tried Global Error handling methods to resolve the issue but no luck. I tried Using ExceptionHandler
I want to send empty response with 404 status code. How can I do that?
I tried to capture exception in Application_Error method in Global.asax file. But this method is not being executed. I already have defined default controller which takes care of non existing urls with status code 404. It only fails when url contains space.