c# - Web Api route {id:int}.xlsx is not found -
I have an API endpoint that will export as some Excel Excel Xlsx file. The URL I try to get is as follows: localhost / service / resources / 123.xlsx
(because I think this is a good way to use this extension). But it did not always get me a 404.
The Administrator has a Root Prefix: [RoutePrefix ("resources")]
and the path attribute on the action is: [root ("{id: int}. Xlsx ")]
Even when I changed the route to [root (" 123.xlsx ")]
I will not find it Also tried to do with a resux barrier [root ("{key: regex (\\ d + \\. Xlsx}")]
with no luck.
I suspect That it can be caught by the static file handler, but already in the web config settings
& lt; modules are run AllManagedModulesForAllRequests = "true" />
I believe this should work because it's a lot in the previous project Worked for the same route, using the old routing setup and not attribute of routing. That project was not used owine, but is this problem here?
How can I Is this work? I need this route and for both GET and PUT
BTW will return a separate representation of the host / service / resource / 123> resource.
Information: hosted using Oviin 3.0 and Web API 5.2.2 in IIS 7.5
I have found that adding this line of code
the app. Usage Stamer (pipeline station.apphandler);
After
<<> Startup class in code> app UsaveP ()
it worked!
(I really do not really understand this, but hey, who cares)
Comments
Post a Comment