fields = [(
    '\xe0\xa6\xaa\xe0\xa7\x8d\xe0\xa6\xb0\xe0\xa6\xbe\xe0\xa6\xaf\xe0\xa6\xbc',
    42), ('bar', '23'), ('foo', '\xde\x82\xde\xb0:')]
files = [('myfile', 'image.jpg', open('image.jpg', 'rb'))]
content_type, body = MultipartFormdataEncoder().encode(fields, files)
Python standard library to POST multipart/form-data encoded data