Skip to content
Advertisement

How to send array of buffer data in aws-lambda payload?

I am working on functionality, where i needs to send array of buffer containing imageData In object along with some other fields,

SAMPLE INPUT :

JavaScript

I tried using JSON.stringify(payload) but it’s not working, might be the issue with buffer, i am not sure it’s converting back buffer properly or not.

Advertisement

Answer

A way to deal with this just pass payload as JSON.stringify(payload) what JSON.stringify is doing with buffer data is it’s converting buffer data like this

JavaScript

so you can convert back into in it’s original form by just doing this

JavaScript

you will get the original buffer back.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement