Hey everyone,
i am having this problem where I want to download an assets (zipfile) from a private repo on GitHub.
I've started to develop it with requests
from there everything worked fine... now I am trying to port it to urllib2
for C4D but it doesn't work anymore...
'Accept': 'application/octet-stream'
will always result in: HTTP Error 415: Unsupported Media Type
If I get rid of 'Accept': 'application/octet-stream'
it will give me the application/json
headers = {
'Authorization': 'token %s' % (MYTOKEN),
'Accept': 'application/octet-stream',
}
url = 'https://api.github.com/repos/USER/REPO/releases/ID'
request = urllib2.Request(url, headers=headers)
response = urllib2.urlopen(request)
print response.read()
#GIVES ME:
#urllib2.HTTPError: HTTP Error 415: Unsupported Media Type
Any idea how to avoid the HTTP Error 415
and download the zip to disk?
Really hard to find something about this anywhere...
Any help is appreciated.
Thanks,
Lasse