Created
June 11, 2020 14:49
-
-
Save dmtmov/7f72da7dd9310e858132183549dbb517 to your computer and use it in GitHub Desktop.
urllib3 multipart/form-data
This file contains hidden or 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
import urllib3 | |
r = http.request( | |
'POST', | |
'https://example.com/createRecord', | |
fields={ | |
'foo': 'bar', | |
'your_field': ('filename.tar.gz', open('full/path/filename.tar.gz', 'rb').read()) | |
}) | |
print(r.data) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment