Skip to content

Instantly share code, notes, and snippets.

@tofusoup429
Created October 6, 2021 04:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tofusoup429/2a9773e2736fa65a3ce8f31a2ceafa85 to your computer and use it in GitHub Desktop.
Save tofusoup429/2a9773e2736fa65a3ce8f31a2ceafa85 to your computer and use it in GitHub Desktop.
{
"body" : $input.json('$'),
"headers": {
#foreach($header in $input.params().header.keySet())
"$header": "$util.escapeJavaScript($input.params().header.get($header))" #if($foreach.hasNext),#end
#end
},
"method": "$context.httpMethod",
"params": {
#foreach($param in $input.params().path.keySet())
"$param": "$util.escapeJavaScript($input.params().path.get($param))" #if($foreach.hasNext),#end
#end
},
"query": {
#foreach($queryParam in $input.params().querystring.keySet())
"$queryParam": "$util.escapeJavaScript($input.params().querystring.get($queryParam))" #if($foreach.hasNext),#end
#end
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment