Skip to content

Instantly share code, notes, and snippets.

@DhruvaDave
Created December 19, 2020 14:11
Show Gist options
  • Save DhruvaDave/88c1f9156c409ece37d65ffb92aaf0ed to your computer and use it in GitHub Desktop.
Save DhruvaDave/88c1f9156c409ece37d65ffb92aaf0ed to your computer and use it in GitHub Desktop.
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