本文整理汇总了Python中Resource.Resource.setSessionToken方法的典型用法代码示例。如果您正苦于以下问题:Python Resource.setSessionToken方法的具体用法?Python Resource.setSessionToken怎么用?Python Resource.setSessionToken使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Resource.Resource
的用法示例。
在下文中一共展示了Resource.setSessionToken方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Resource
# 需要导入模块: from Resource import Resource [as 别名]
# 或者: from Resource.Resource import setSessionToken [as 别名]
# -*- coding: UTF-8 -*-
import simplejson
from Resource import Resource
datacloud = Resource('A6988846915732','391BB7B7-827D-1DE5-2F64-04339E801812','http://192.168.13.183/mcm/api')
#################user operation##############################
# print datacloud.createUser({"username":"abc","password":"123456","email":"[email protected]"})
r = datacloud.userLogin('zxh','123456')
datacloud.setSessionToken(r["id"])
# print datacloud.userLogout(r["id"])
# r = datacloud.verifyEmail({"username":"zxh","email":"[email protected]","language":"zh_CN"})
# print simplejson.dumps(r, ensure_ascii=False)
# print r['msg']
# print r['status']
# print datacloud.resetRequest({"username":"zxh","email":"[email protected]","language":"zh_CN"})
# print datacloud.getUserInfo('5576b9eec24a9b3c54f82203');
# print datacloud.updateUserInfo({'userId':'55796f23dfc407df41432f94','address':'dandong'})
# print datacloud.deleteUser('55796f23dfc407df41432f94');
#################object operation##############################
# print datacloud.createObject("company",{"address":"丹东1", "name":"aaa","icon":{"isFile":True,"path":"E:\\2007119124513598_2.jpg"},"icon2":{"isFile":True,"path":"E:\\2007119124513598_2.jpg"}})
# print datacloud.createObject("company",{"address":"germany", "name":"ccc","icon":{"url":"http://a82510f6efdff35a65fb.b0.upaiyun.com/apicloud/e96e53bb577560b2d5acb1e3ef7a492b.jpg","id":"5578114b85ff91bf364f0d6a","name":"2007119124513598_2.jpg"}})
# print datacloud.getObject('company','55828f4c291f49171a8dba9b')
# print datacloud.updateObject('company','5578125185ff91bf364f0d6c',{'address':'dandong',"icon":{"isFile":True,"path":"E:\\zhanqi.PNG"}})