Reputation: 1659
I am trying to send data to my lambda function however the function is not getting my data, the event
variable is empty. I am not getting any errors and when I test the function in my API Gateway it works fine. So I am not sure what is happening. My code for sending data to Lambda is below.
var options = {
method: 'POST',
url: 'correct api url',
contentType: "application/json",
dataType: "json",
data: s
}
for data: s
within my console looks like this data: '{"article_url":"a url here"}'
Any idea what the problem is?
Upvotes: 0
Views: 3207
Reputation: 4414
In the "Integration Request" configuration, make sure you've checked the "Use Lambda Proxy integration" checkbox.
And make sure your output matches the schema defined here to avoid errors:
{
"isBase64Encoded": true|false,
"statusCode": httpStatusCode,
"headers": { "headerName": "headerValue", ... },
"body": "..."
}
Upvotes: 0