- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用 ocelot 网关。
这里是示例配置
{
"DownstreamPathTemplate": "/ipgeo?apiKey={key}&ip={ip}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "api.ipgeolocation.io",
"Port": 80
}
],
"UpstreamHttpMethod": ["GET"],
"UpstreamPathTemplate": "/GLI/secondary?apiKey={key}&ip={ip}"
}
如您所见,有两个查询参数。当我使用 postman 发送请求时:
http://localhost:5000/GLI/secondary?apiKey=aaa&ip=8.8.8.8
OCELOT 获取重复的查询参数并生成如下下游 url:
http://api.ipgeolocation.io/ipgeo?apiKey=aaa&ip=8.8.8.8&apiKey=aaa&ip=8.8.8.8
控制台屏幕:
info: Ocelot.Requester.Middleware.HttpRequesterMiddleware[0]
requestId: 0HMFNFVDSDQH9:0000000A, previousRequestId: no previous request id, message: 301 (Moved Permanently) status code, request uri: http://api.ipgeolocation.io/ipgeo?apiKey=aaa&ip=8.8.8.8&apiKey=aaa&ip=8.8.8.8
我怎样才能改变这个?
最佳答案
同样的问题,
我的作品使用这种语法,基本上我已经删除了“?” UpstreamPathTemplate
中的符号:
"DownstreamPathTemplate": "/GLI/secondary?{everything}"
"UpstreamPathTemplate": "/GLI/secondary{everything}"
关于asp.net - Ocelot Gateway 重复查询参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71250588/
根据 documentation我尝试合并我的配置文件,以便它们更具可读性。然而,生成的 ocelot.json 文件并不像预期的那样。我的文件夹结构如下: Folder structure 下面是这
我已经将 Ocelot 与 Asp.Net Core 2.1 一起使用并且它可以正常工作,但是当与 Asp.Net Core 3.1 一起使用时它根本不起作用。在我看来,它没有获取“ocelot.js
我已经将 Ocelot 与 Asp.Net Core 2.1 一起使用并且它可以正常工作,但是当与 Asp.Net Core 3.1 一起使用时它根本不起作用。在我看来,它没有获取“ocelot.js
你好现在我正在尝试使用 Ocelot 网关 通常我在不同的服务器上有一个 api https://server_domain.net/kpiDashboardApi 没有网关,如果我直接向下面的链接发
我设计的微服务架构如下: 网关使用 Ocelot 转发请求。我想更改从网关端的移动设备收到的请求中的正文,并在正文中添加新的 GUID。微服务使用 CQRS 模式,因此命令不应返回任何内容。我实现了自
在两个不同的端口上有两个 API。我想用地址 (IP:port ) 来调用它们。为此,我使用了 ocelot api gateway。但是运行程序时,返回如下错误 System.InvalidOper
有什么方法可以将 Ocelot 与多个配置文件和环境一起使用,例如 ocelot.service1.Development.json? 不幸的是,文档似乎已经过时,而且它不处理我的特定请求。我看到它可
我有多个微服务可供客户通过 Ocelot 访问网关。在配置文件中,有一些属性可以指定下游主机和端口。这必须为每条路线完成。 问题是,如果服务的主机名或端口发生变化,我将不得不修改与该特定服务关联的每条
我将 Ocelot 和 API 网关与 Consul 和服务发现一起使用。我正在 Consul 中使用动态名称注册服务,例如:service.name.1234 和 service.name.5678
根据 Ocelot 文档 Quality Of Service我们只能在路由中提及 TimeOutValue,比如 "QoSOptions": { "TimeoutValue":5000 }
我正在使用 ocelot 网关。 这里是示例配置 { "DownstreamPathTemplate": "/ipgeo?apiKey={key}&ip={ip}", "DownstreamS
我正在尝试将 Ocelot 与 IS4 一起使用 https://ocelot.readthedocs.io/en/latest/features/authentication.html 使用时 pu
我必须在 ocelot 身份验证之前对请求的 jwt 进行一些检查,所以我在 PreAuthenticationMiddleware 中进行检查像这样: var config = new Ocelot
有没有办法告诉 Ocelot 一个参数是可选的? 假设下面的查询参数是可选的: "DownstreamPathTemplate": "/api/SearchAPI/?query={query}", "
在将传入的 http 请求转发到下游路径时,我正面临此警告/错误。 Ocelot.DownstreamRouteFinder.Middleware.DownstreamRouteFinderMiddl
我正在尝试在 Api 网关中设置 Ocelot,但我卡在了授权上。我已经设法设置声明,并且可以在我的 Controller 中授权它们。我向这样的用户添加声明: await userManager.A
我正在尝试在 Api 网关中设置 Ocelot,但我卡在了授权上。我已经设法设置声明,并且可以在我的 Controller 中授权它们。我向这样的用户添加声明: await userManager.A
我在我的新项目中实现了 ocelot,我使用 ocelot 在一个点上创建了我的服务集成,但是当我尝试发布、放置、路径或删除到我的 api 网关中的资源时,浏览器向我显示消息 Failed to lo
我使用多个无状态和有状态服务创建了 Azure 服务结构应用程序。我所有的有状态服务都可以通过 Web Api 无状态服务访问。现在,我已将 Ocelot API 网关添加到另一个无状态 Web AP
我使用多个无状态和有状态服务创建了 Azure 服务结构应用程序。我所有的有状态服务都可以通过 Web Api 无状态服务访问。现在,我已将 Ocelot API 网关添加到另一个无状态 Web AP
我是一名优秀的程序员,十分优秀!