【发布时间】:2020-05-13 05:34:15
【问题描述】:
假设我有一个像 https://localhost:5000/api/animals/cat/1 这样的 REST 端点,我希望重定向所有包含 /animals 的 URI。如果调用包含字符串animals,然后修改该URI以返回添加少量标头的不同路径,那么在ASP .Net Core中是否有一种方法可以在初始阶段检测到?
【问题讨论】:
-
你可以使用Route Constraints
标签: c# asp.net-mvc asp.net-core asp.net-core-webapi