http://vdisk.weibo.com/developers/index.php?module=api&action=apidoc
Get the authorization url. ###from vdisk import OAuth2
oauth = OAuth2(WEIPAN_APPKEY,WEIPAN_APPSECRET,WEIPAN_CALLBACK)
url = oauth.authorize()
In the callback url.
oauth = OAuth2(WEIPAN_APPKEY,WEIPAN_APPSECRET,WEIPAN_CALLBACK)
#get request parameters using web.py framework
i = web.input()
if i.code.isdigit() and int(i.code) == 21330:
return i.msg
try:
return oauth.access_token(code = i.code)
Request for data using access_token.
obj = Client()
return obj.account_info(access_token)
All the responses will be a Response object(defined in vdisk.py). When download file using files(GET),developers should do this
for content in Response.data():
#you can print content,or save content in a file.
http://pzhu001.sinaapp.com/2/metadata?access_token=f9c6606661ckiME21a9PM3CSQkI60b0a&path=/