I have a simple QR Code scanner that sends an API request to a server (it is factory made like that) I want this QR code send the data to a lambda that I have on AWS through an API gateway.
The QR code scanner sends the reading result in pure plain text by POST method but my post api gateway only accepts json, I need it to accept pain text and pass it to my lambda.
Is this possible?
Thanks
To achieve your goal of having your QR code scanner’s plain text data sent to your AWS Lambda function via API Gateway, you can configure the API Gateway to accept plain text requests and then transform the data into a JSON format that your Lambda function can consume.
First, configure the API Gateway to accept plain text requests by setting the “Content-Type” header to “text/plain” in the API Gateway’s method settings.
Then create a custom integration with the API Gateway, where you can use a Lambda function to transform the plain text data into a JSON payload that your Lambda function expects.
1