Quantcast
Channel: Active questions tagged rest - Stack Overflow
Viewing all articles
Browse latest Browse all 3619

API Gateway and Lambda: Async call

$
0
0

I have a REST API gateway that receives a POST from a client and pass this POST to a Lambda, adding to be an assync call. However, I want the gateway to return to the client before the lambda processing. Right now I'm getting an error from the Lambda code, so the gateway is waiting for the lambda to finish.

Post from client to gateway:

payload = {'token': 'aa','challenge': 'bb','type': 'url_verification'}

Post from gateway to lambda

{'body':     {'token': 'aa', 'challenge': 'bb', 'type': 'url_verification'}, 'X-Amz-Invocation-Type': 'Event'}

Return from gateway to client

Status Code: 200 Response Text: {"errorMessage": "the JSON object must be str, bytes or bytearray, not     dict", "errorType": "TypeError"... 

Basically this error is from the main.py code in the lambda function. But to the client this does not matter, I only want the client to know that the gateway received the message and called lambda.


Viewing all articles
Browse latest Browse all 3619

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>