通过API网关将图像传递到Python3 AWS Lambda

时间:2019-03-24 01:08:23

标签: python-3.x amazon-web-services aws-lambda aws-api-gateway

我想通过API网关将图像上传到AWS lambda。如何从Lambda处理程序获取图像?

本地代码:

import requests
url = 'https://_________.execute-api.us-east-1.amazonaws.com/default/_________'
files = {'image': open('image.jpg', 'rb')}
r = requests.post(url, files=files)
print(r.content)

Lambda代码:

def lambda_handler(event, context):
    image = event['image']??????????????<---HOW DO I GET THE IMAGE?????????????????

注意:我不想将图像上传到S3,然后从Lambda中从S3获取图像

0 个答案:

没有答案