I have created an aws lambda function using c# in visual studio 2017 and I'm having problems with the parameters. I am trying to get the 'querystringparameter' but every time I put a parameter in my FunctionHandler I get this error.
{
"errorType": "JsonReaderException",
"errorMessage": "Unexpected character encountered while parsing value: {. Path '', line 1, position 1.",
"stackTrace": [
"at Newtonsoft.Json.JsonTextReader.ReadStringValue(ReadType readType)",
"at Newtonsoft.Json.JsonTextReader.ReadAsString()",
"at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.ReadForType(JsonReader reader, JsonContract contract, Boolean hasConverter)",
"at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)",
"at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)",
"at Newtonsoft.Json.JsonSerializer.Deserialize[T](JsonReader reader)",
"at lambda_method(Closure , Stream , Stream , ContextInfo )"
]
}
This is my sample FunctionHandler code :
public string FunctionHandler(APIGatewayProxyRequest request, ILambdaContext context)
{
var sample = GetParameters(request.QueryStringParameters, "sample");
return sample;
}
What's wrong with this ? Answers would be very much appreciated. Thank you !
UPDATE