The web api seems to be suitable only for standard use cases. But I want to make more complex routing, but I can not find documentation for complex routing. If I have more controller, the routes are getting harder.
Can I define some optional parameters with dependencies? Like this:
/api/document/{par1}/{par2}
par1 and par2 should be optional, but par2 should only be consistent if par1 is present.
And are recursive parameters possible?
/api/documents/characteristics/{round/green/red-dots}
/api/documents/characteristics/{square/yellow}
/api/documents/characteristics/{square/yellow/flat}
/api/documents/characteristics/{square/yellow/flat/...}
Is there any detailed documentation for web api routing? The microsoft tutorial is too simple ... I need more information about routing.
, , . [Action] -Attribute , ... . , .
web api api?
Edit:
:
routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{mandant}/documents/{id}",
defaults: new { controller = "documents", id = RouteParameter.Optional }
);
:
[AcceptVerbs("get")]
public HttpResponseMessage Get(int id)
[ActionName("file")]
[AcceptVerbs("get")]
public HttpResponseMessage filedownload(int id)
, , , , ... [NoAction], ...
-, ? (, , get-document, URL ...)
, .