My body mapping is defined as:
{
"csv": "$input.body",
"p1": false,
"p2": "p3",
"p3": "p4"
}
Invoking the function with
curl 'https://xxxxx.execute-api.us-west-2.amazonaws.com/prod/xxx?p3=aaa&p4=bbb' \
-XPOST -H "Content-Type: application/csv" -d @input.csv
Where input.csv contains
l1c1,l1c2
l2c1,l2c2
l3c1,l3c2
Will end up with calling my lambda function with
{
"csv": "l1c1,l1c2l2c1,l2c2l3c1,l3c2",
"p1": false,
"p2": "p3",
"p3": "p4"
}
Is there a way NOT to remove the newlines from the body? $input.body should evaluate to the "RAW PAYLOAD" according to the docs here http://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-mapping-template-reference.html#d0e9653
Also tried using $util.escapeJavaScript($input.body), but it does not make any difference at all.
Decoding $util.base64Encode($input.body) also has the newlines stripped...
Thanks,