如何对python中的用户进行Jawbone UP.With有效凭据的身份验证?
发布于 2013-12-26 11:40:34
email ='your email id'
pwd = 'your password'
data = urllib.parse.urlencode({'email': email, 'pwd':pwd, 'service': 'nudge'})
data = data.encode('utf-8')
request = urllib.request.Request("https://jawbone.com/user/signin/login")
# adding charset parameter to the Content-Type header.
request.add_header("Content-Type","application/x-www-form-urlencoded;charset=utf-8")
f = urllib.request.urlopen(request, data)
#print(f.read().decode('utf-8'))
j=(f.read().decode('utf-8'))
b=json.loads(j)现在json对象b包含关于用户的所有数据,如名称、权重等.
https://stackoverflow.com/questions/20490662
复制相似问题