I'm trying to learn Lambda but I'm struggling with a simple function that takes in a string as an input parameter and upper cases it:
it's written in C#.
public class Function
{
public string FunctionHandler(string input, ILambdaContext context)
{
return input?.ToUpper();
}
}
I then set up a API Gateway with a get request. It has a mapping template on an integration request, like so:
{
"input":$input.params("text")
}
I'm trying to call it at the url:
https://xxxxxxx.execute-api.xxxxxxx.amazonaws.com/Prod?test=hello
But I get an error returned:
{ "message": "Could not parse request body into json: Unexpected character (\'}\' (code 125)): expected a value\n at [Source: (byte[])\"{\n\n \"input\":\n\n}\"; line: 5, column: 2]"}