I'm trying to send one image to my Lambda Function using Python just to test for one project, but Postman is giving me one error and I don't know how to solve it.
My code is simply to detect if I have some data in the key "image" and return some message. I'm using Postman to send the POST request, I clicked in the Body tab, selected the form-data option and I wrote image for the key and selected the image file from my computer (the image size is 27 kb). This is the code in my Lambda Function:
def lambda_handler(event, context):
if event['image']:
return {
"Message": 'Everything went ok'
}
And this is the error message that I'm receiving from Postman:
{ "message": "Could not parse request body into json: Unexpected character ('-' (code 45)) in numeric value: expected digit (0-9) to follow minus sign, for valid numeric value\n at [Source: (byte[])"----------------------------137965576541301454606184\r\nContent-Disposition: form-data; name="image"; filename="TestImage.png"\r\nContent-Type: image/png\r\n\r\n�PNG\r\n\n ... }