Created
November 15, 2016 15:58
-
-
Save dinoocch/8d13401ad5745d1aaf51167b19394920 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body = """--{boundary} | |
Content-Type: application/json; charset=UTF-8 | |
Content Disposition: attachment; name="metadata" | |
{{"message": "{message}"}} | |
--{boundary} | |
Content-Type: img/png | |
Content-Disposition: attachment; name="file"; filename="grafana.png" | |
Content-Transfer-Encoding: base64 | |
{image} | |
--{boundary} | |
""".format(message="test", boundary=binascii.b2a_hex(os.urandom(15)), image="BASE64ENCODEDIMAGE") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment