API 网关 SQS 响应以 UnknownOperationException 结束

问题描述 投票:0回答:2

我有一个将请求路由到SQS的API网关,API网关具有向SQS发送消息所需的权限(创建的IAM角色),当我发送测试数据时,我将得到下面带有UnknownOperationException的响应。

SQS 也是空的,没有可用消息。

Tue Nov 09 13:46:11 UTC 2021 : Sending request to https://sqs.ca-central-1.amazonaws.com/XXXXXXXX/XXXX
Tue Nov 09 13:46:11 UTC 2021 : Received response. Status: 404, Integration latency: 2 ms
Tue Nov 09 13:46:11 UTC 2021 : Endpoint response headers: {x-amzn-RequestId=e63b5577-9866-569d-85d8-0f73e5851cf0, Date=Tue, 09 Nov 2021 13:46:11 GMT, X-Amzn-Trace-Id=Root=1-618a7ba3-dd93ee11df45d437f9c98705, Content-Type=null, Content-Length=29}
Tue Nov 09 13:46:11 UTC 2021 : Endpoint response body before transformations: <UnknownOperationException/>

Tue Nov 09 13:46:11 UTC 2021 : Method response body after transformations: <UnknownOperationException/>

有什么想法吗?

amazon-web-services aws-api-gateway amazon-iam amazon-sqs
2个回答
4
投票

要解决该问题,您必须将 Content-Type:'application/x-www-form-urlencoded' 标头添加到集成请求中: 集成请求标头


© www.soinside.com 2019 - 2024. All rights reserved.