简体   繁体   English

不使用 API 网关代理集成无法调用后端服务

[英]unable to call backend service without using API Gateway Proxy Integration

I have a PATCH method/resource in my API Gateway that needs to call backend service when I select to use proxy integration I was able to get the proper response but If I disable proxy integration I'm getting a 406 error from backend with PATCH /error Below are my API settings我的 API 网关中有一个 PATCH 方法/资源,当我 select 使用代理集成时需要调用后端服务,我能够得到正确的响应,但是如果我禁用代理集成,我会从后端使用PATCH /error收到 406 错误PATCH /error以下是我的 API 设置在此处输入图像描述 在此处输入图像描述

Do I need to add any extra configuration under the mapping template?我需要在映射模板下添加任何额外的配置吗?

@patrick I'm not sure if this will help, but this might give you some insight as to the actual error message. @patrick 我不确定这是否会有所帮助,但这可能会让您对实际的错误消息有所了解。 In APIGW Console, select the "Gateway Responses" item on the left-hand menu.在 APIGW 控制台中,select 左侧菜单上的“网关响应”项。 Find Default 4XX and add a Response Template of application/json .找到 Default 4XX 并添加application/json的响应模板。 Set the Response Template Body to {"message":$context.error.messageString} .将响应模板正文设置为{"message":$context.error.messageString} This should deliver a more specific error message as to what is wrong.这应该提供更具体的错误消息,说明什么是错误的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM