Note that there are some explanatory texts on larger screens.

plurals
  1. POIs it possible to change ASP.NET MVC 3 route constraints such that they return 400 Bad Request with JSON bodies?
    primarykey
    data
    text
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. COCan you explain why you couldn't use a catch-all route that maps to a controller under your control? For example, my blog engine (FunnelWeb) uses this to show a Search page instead of a 404. see http://wallaceturner.com/blah/blah2 this could trivially be changed to return a JSON string.
      singulars
    2. COHadn't considered of the catch-all route. I'll have to check it out...however I'm curious if I would have error information from previous routes? If a route fails due to THAT ROUTES constraints, I want to send back a message that indicates the problem, so the client will know what went wrong. The catch-all route may be a partial solution, but if I can't access any information that explains why routing failed, it would remain just a partial fix.
      singulars
    3. CO`but if I can't access any information that explains why routing failed` Can't your unit tests cover this? routeDebugger etc? its impossible to determine what route you think your clients(not under your control) were trying to go down. Actually, I kind of see a situation you might want to handle - to see if we're on the same page could you give an example where the catch-all wouldn't work? it sounds like you might need to have catch-all's for each of your routes/controller pairs...
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload