http://documentation.mailgun.net/quickstart.html包含一些 Django 中 http 处理程序的示例代码:
# Handler for HTTP POST to http://myhost.com/messages for the route defined above
def on_incoming_message(request):
if request.method == 'POST':
sender = request.POST.get('sender')
recipient = request.POST.get('recipient')
subject = request.POST.get('subject', '')
body_plain = request.POST.get('body-plain', '')
body_without_quotes = request.POST.get('stripped-text', '')
# note: other MIME headers are also posted here...
# attachments:
for key in request.FILES:
file = request.FILES[key]
# do something with the file
# Returned text is ignored but HTTP status code matters:
# Mailgun wants to see 2xx, otherwise it will make another attempt in 5 minutes
return HttpResponse('OK')
ASP.NET C# 中的等价物是什么?
例如,我尝试过 Request.Form["sender"],但 Mailgun 日志记录了 HTTP 500 错误代码。
谢谢你的帮助。