I want to be able to do RequestValidation on content-type "application/json" in a consistent manner to Form validation ("application/x-www-form-urlencoded").
I've read https://msdn.microsoft.com/en-us/library/system.web.util.requestvalidator(v=vs.110).aspx but it hasn't been too much help.
I'm looking at trying to implement a custom request validator to replace the default System.Web.Util.RequestValidator.
I've also looked at https://msdn.microsoft.com/en-us/library/system.web.util.requestvalidator(v=vs.110).aspx
If I can't get the input to be consistently validated I will probably remove the ability to send json to the controllers and force everything through forms - not ideal as I'd like some methods to accept json.
I already encode the output (where possible) but I still want defense in depth by validating the input and ideally consistently for forms and json.
Unfortunately a lot of the MSDN docs on this are heavily out of date and now irrelevant.
I'm using .net 4.6.1 for reference.
Is it sensible to try and validate requests in this manner?