How can i pass a JSON object like {val: 1}
to my Lambda function as a query parameter?
Following Standardized way to serialize JSON to query string? i URL-encoded my JSON object and requested the following: mysite.com/path?json=%7B%22val%22%3A%201%7D
As requestTemplates i tried the following two options
"json": "$input.params().querystring.json"
"json": "$util.parseJson($input.params().querystring.json)"
But i got this error message:
{"message": "Could not parse request body into json: Unexpected character (\'v\' (code 118)): was expecting comma to separate OBJECT entries\n at [Source: [B@37a2970e; line: 1, column: 47]"}
If i do not encode the query string so: mysite.com/path?json={"val":1}
i get a 400 error