Here is my lambda function:
@Override
public List<JobData> handleRequest(Map<String,String> searchFilters, Context context) {
List<JobData> jobs = new ArrayList<>();
if(searchFilters.get("job_title") != null){
// populate jobs list using a method.
}else{
// populate jobs list using another method.
}
return jobs;
}
I used the below test event for testing the lambda:
And the lambda function is working as expected for the above mentioned test input.
Then, I created an API gateway with a POST request triggering the above mentioned lambda function:
Then, I used the REST API gateway to send a POST request with the below body content with a header Content-Type : application/json.
request body:
{
"job_title": "software engineer"
}
But it is navigating to the else block in the lambda code (indicating that API gateway is not properly intercepting the POST request parameters) which is not expected.
I tried permutations and combinations with the API gateway configurations in AWS. But none of them worked. I get a feel that my lambda function might need to be changed to make it work with API gateway. What can I try next?


