【发布时间】:2022-02-20 22:45:51
【问题描述】:
我目前被请求直通卡住了。我需要使用步进函数管道处理来自标头和请求正文的信息。我正在使用集成请求中具有以下映射模板的 REST API 网关
#set($data = $util.escapeJavaScript($input.json('$')))
{
"input": "{ \"input\": $data, \"stageVariables\" : { #foreach($key in $stageVariables.keySet()) \"$key\" : \"$util.escapeJavaScript($stageVariables.get($key))\" #if($foreach.hasNext),#end #end } }",
"stateMachineArn": "arn:aws:states:eu-west-1:xxxxxxxxxxxx:stateMachine:StateMachine-1"
}
但这不起作用。如果我要使用 lambda 事件访问标头,那将是 事件['headers']['授权'] 但我只将请求的正文作为我的步进函数的输入。
当我对整个请求使用数据流模拟器,然后将 JsonPath 带入我的状态机模板时,它仍然没有给我标题和正文作为输入。
有人可以帮我吗?
【问题讨论】:
标签: json amazon-web-services aws-api-gateway aws-step-functions