【发布时间】:2016-03-02 07:19:42
【问题描述】:
我有这个函数在 python 中按预期工作。 如何将其转换为 AWS Lambda 函数?
def mymailgun(url):
import urllib2
myfile=urllib2.urlopen(url)
import requests
print requests.post("https://api.mailgun.net/v3/XXX.mailgun.org/messages",
auth=("api", "key-XXX"),
files=[("attachment", myfile)
#("attachment", open("files/test.txt"))
],
data={"from": "Excited User <excited-user@example.com>",
"to": "XXX@gmail.com",
"cc": "YYY@yahoo.com",
"bcc": "ZZZ@hotmail.com",
"subject": "Hello",
"text": "Testing some awesomness with attachments!",
"html": myfile})
【问题讨论】:
标签: python aws-lambda