Search code examples
asp.net-mvcattributerouting

How can I catch all requests starts with /X in AttributeRouting


Urls: /X?take=1&skip=4

[GET("X/{request:alpha?}", IsAbsoluteUrl = true)]

[GET("X{request:alpha?}", IsAbsoluteUrl = true)]

[GET("X{request:alpha*}", IsAbsoluteUrl = true)]

does not work.


Solution

  • Because using POST Attribute is preventing to GET request handling.

    I was using both POST and GET. I've changed them to ROUTE.