Last active
February 27, 2020 09:13
-
-
Save rahulvramesh/0d5c5a44a469f7fb6e91ca4196c2993e to your computer and use it in GitHub Desktop.
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 requests | |
| import os | |
| import http.client as http_client | |
| import logging | |
| http_client.HTTPConnection.debuglevel = 1 | |
| logging.basicConfig() | |
| logging.getLogger().setLevel(logging.DEBUG) | |
| requests_log = logging.getLogger("requests.packages.urllib3") | |
| requests_log.setLevel(logging.DEBUG) | |
| requests_log.propagate = True | |
| image_filename = os.path.basename("/Users/rahulvramesh/Downloads/HHmachine001_HHdevice01_camera02_2020-02-26-18_19_22.mp4") | |
| multipart_form_data = { | |
| 'file': (image_filename, open("/Users/rahulvramesh/Downloads/HHmachine001_HHdevice01_camera02_2020-02-26-18_19_22.mp4", 'rb')), | |
| } | |
| print(image_filename) | |
| print(multipart_form_data) | |
| response = requests.post('http://18.141.141.91:8005/upload', | |
| files=multipart_form_data) | |
| print(response.text) | |
| #Total Time To Upload | |
| #0.16s user 0.18s system 0% cpu 59.017 total |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment