我正在尝试将github问题api集成到一个项目中.我想我遵守了oauth的规则,以及http://develop.github.com/p/issues.html上需要和提到的所有内容,但它似乎不起作用.我没有收到详细的错误消息,只有401.
用django,python实际实现:
url = 'https://github.com/login/oauth/access_token?client_id=%(client_id)s&redirect_uri=%(redirect_uri)s&client_secret=%(client_secret)s&code=%(code)s' % locals()
req = urllib2.Request(url)
response = urllib2.urlopen(req).read()
access_token = re.search(r'access_token=(\w+)', response).group(1)
url = 'http://github.com/api/v2/json/issues/open/%(user)s/%(repo)s' % locals()
params = urllib.urlencode({'login': user, 'token': access_token, 'title': 'title', 'body': 'body'})
req = urllib2.Request(url, params)
try:
response = urllib2.urlopen(req)
except HTTPError, e:
return HttpResponse('[*] Its a fckin %d' % e.code)
except URLError, …Run Code Online (Sandbox Code Playgroud) 有人可以展示一些关于使用django的dropbox api的例子吗?安装Dropbox api,自述完成,测试完成,如何进一步完成?