OCELOT API网关实施中的帖子动词的问题
这是我的ocelot.json,当我击中 https:// localhost:44368/weatherforecast 时,它可以正常工作。但是,当我发布post https:// localhost:44368/login 的用户登录请求时,它会返回404错误。我真的很想念我找不到。但是当我使用直接URL时,它可以正常工作。 swagger_result
Console Log
Error Code: UnableToFindDownstreamRouteError Message: Failed to match Route configuration for upstream path: /Login, verb: POST
ocelot.json file
{
"Routes": [
{
"DownstreamPathTemplate": "/api/WeatherForecast/Get",
"DownstreamScheme": "https",
"DownstreamHostAndPorts": [
{
"Host": "localhost",
"Port": "44385"
}
],
"UpstreamPathTemplate": "/WeatherForecast",
"UpstreamHttpMethod": [
"GET"
]
},
{
"DownstreamPathTemplate": "/api/Auth/Login",
"DownstreamScheme": "https",
"DownstreamHostAndPorts": [
{
"Host": "localhost",
"Port": "44320"
}
],
"UpstreamPathTemplate": "/Login",
"UpstreamHttpMethod": [
"POST"
]
}
]
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

我找到了解决我问题的解决方案,即基于环境变量,
我在ocelot.json文件上添加了下游映射,但是我的设置
总是找到一个始终发现的是, ocelot.development.json我没有将下游映射/login
I found the solution to my problem, that is there is two ocelot.json files based on the environment variable,
I added the downstream mapping on ocelot.json file, but my settings was
it always finds the ocelot.development.json where I didn't put the downstream mapping for /Login