You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

API Gateway与CloudSearch集成时的斜杠编码异常问题求助

API Gateway与CloudSearch集成时的斜杠编码异常问题求助

大家好,我最近在尝试集成AWS API Gateway和CloudSearch时遇到了一个棘手的问题,我是按照官方文档的步骤来操作的,但还是出现了异常。

问题出在编码处理上:我的后端服务会发送编码后的请求参数到API Gateway,但API Gateway会先对参数进行解码,再转发给CloudSearch,这就导致了错误。

举个具体的例子:

  • 后端服务发送的参数:pretty%3Dtrue%26fq%3Dsectors%3A%27One%2FTwo%27%26q%3Dmatchall%26q.parser%3Dstructured
  • API Gateway解码后的参数:pretty=true&fq=sectors:'One/Two'&q=matchall&q.parser=structured
  • 最终转发给CloudSearch的参数:q=matchall&pretty=true&q.parser=structured&fq=sectors:'One/two'

可以看到,原本编码的斜杠%2F在到达CloudSearch时已经变成了未编码的/,这直接导致CloudSearch返回404错误。

我之前也发现过一个类似的问题线程,但目前还没有找到解决办法,想在这里求助大家有没有遇到过同样的情况,或者有什么可行的解决方案?

备注:内容来源于stack exchange,提问作者Denied5

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.16 09:04:37