Created
December 19, 2020 14:11
-
-
Save DhruvaDave/88c1f9156c409ece37d65ffb92aaf0ed 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
def download_item(): | |
uri_path = "/sf/v3/Items(%s)/Download" % (item_id) | |
http = httplib.HTTPSConnection(self.get_hostname(token)) | |
http.request("GET", uri_path, headers=self.get_authorization_header(token)) | |
response = http.getresponse() | |
location = response.getheader("location") | |
if location: | |
urllib.request.urlretrieve(location, "/home/Downloads/item.zip") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment