You can use something like this. It's a basic implementation but it should work.
import pycurl, json
postmark_url = 'https://api.postmarkapp.com/email'
data = json.dumps({"From": "[email protected]", "To": "[email protected]", "Subject": "Pycurl", "TextBody": "Some text"})
c = pycurl.Curl()
c.setopt(pycurl.URL, github_url)
c.setopt(pycurl.HTTPHEADER, ['X-Postmark-Server-Token: API_TOKEN_HERE','Accept: application/json'])
c.setopt(pycurl.POST, 1)
c.setopt(pycurl.POSTFIELDS, data)
c.perform()
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…