Can someone give a python requests example of uploading a release asset in github?
问题 url = 'https://github.abc.defcom/api/v3/repos/abc/def/releases/401/assets?name=foo.sh' r = requests.post(url, headers={'Content-Type':'application/binary'}, data=open('sometext.txt','r'), auth=('user','password')) This is giving me >>> r.text u'{"message":"Not Found","documentation_url":"https://developer.github.com/enterprise/2.4/v3"}' Where am I going wrong? 回答1: So I'll preface this with the advice that if you use a library it's as easy as: from github3 import GitHubEnterprise gh =