AWS lambda中的春季功能未寄回状态代码
我有以下代码工作并返回状态代码。
final APIGatewayProxyResponseEvent responseEvent = new APIGatewayProxyResponseEvent();
responseEvent.setHeaders(Map.of(CONTENT_TYPE, APPLICATION_JSON));
responseEvent.setBody(objectMapper.writerWithDefaultPrettyPrinter().writeValueAsString(response));
responseEvent.setStatusCode(200);
但是,我最近将Spring功能适配器更新为3.2.3,并且不再在响应中收到状态代码。实际上,反应现在只是身体。
我的设置是AWS lambda,使用弹簧功能,在API网关后面。
I had the following code working and returning a statusCode.
final APIGatewayProxyResponseEvent responseEvent = new APIGatewayProxyResponseEvent();
responseEvent.setHeaders(Map.of(CONTENT_TYPE, APPLICATION_JSON));
responseEvent.setBody(objectMapper.writerWithDefaultPrettyPrinter().writeValueAsString(response));
responseEvent.setStatusCode(200);
However i have recently updated the spring function adapter to 3.2.3, and i no longer recieve the status code in the response. In fact the response is now just the body.
My setup is aws lambda using spring function, behind api gateway.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这有效。
this works.