原文地址:http://forum.alisoft.com/read.php?tid=22236
class AliMain(webapp.RequestHandler):
def get(self):
# get all param
aliurl = "http://sipdev.alisoft.com/sip/rest"
appid = self.request.get('app_id')
instanceid = self.request.get('app_instance_id')
target = self.request.get('target')
token = self.request.get('token')
userid = self.request.get('user_id')
timestamp = strftime("%Y-%m-%d %H:%M:%S")
sessionid = '777'
# calculate the signature
data = '1111111111111111111111111'+'appId'+appid \
+'appInstanceId'+instanceid+'sip_apinamealisoft.validateUser' \
+'sip_appkey'+appid+'sip_sessionid'+sessionid \
+'sip_timestamp'+timestamp \
+'token'+token \
+'userId'+userid
coder = md5.new()
coder.update(data)
digest = coder.hexdigest()
# send the auth request
form_fields = {
'sip_timestamp': timestamp,
'sip_appkey': appid,
'appId': appid,
'token': token,
'appInstanceId': instanceid,
'userId': userid,
'sip_apiname': 'alisoft.validateUser',
'sip_sessionid': sessionid,
'sip_sign': digest
}
form_data = urllib.urlencode(form_fields)
result = urlfetch.fetch(url=aliurl,
payload=form_data,
method=urlfetch.POST,
headers={'Content-Type': 'application/x-www-form-urlencoded'})
self.response.out.write(result.content)
ps:我早点找到,多好啊。。。
分享到:
相关推荐
用GAEPhotos建立你自己的网络相册:创建 GAE Python HRD 程序, HRD 是必须的.从 http://code.google.com/p/gaephotos/downloads/list 下载最新版本的GAEPhotos.解压到本地目录.更改 app.yaml 文件的第一行:...
python Google App Engine channel primer
资源分类:Python库 所属语言:Python 资源全名:gae_installer-1.9.7.2.tar.gz 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059
资源分类:Python库 所属语言:Python 资源全名:gae_installer-1.9.17.4.tar.gz 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059
Eclipse开发 Gae,Struts2,Spring,云计算,学习gae云计算的好例子
小学期的项目,一组人用了三周连学习再开发,文档齐全,适合对GAE感兴趣的人入门使用
由...赞助 Google App Engine Boilerplate 使用 Google App Engine 平台快速启动您的项目。 使用 Google App Engine 支持的最新技术创建强大的应用程序。 它将向新开发人员介绍 App Engine 和高级开发人员以遵循...
主要介绍了Using Django with GAE Python 后台抓取多个网站的页面全文,需要的朋友可以参考下
基于GAE python的应用程序,该应用程序定期收集有关BigQuery表的元数据并将其存储在BigQuery中。 创建GCP普查旨在回答以下问题: 我们整个GCP组织中有多少数据? 我们有多少个表/分区? 哪些数据集/表格最大或最...
GoogleAppEngine-1.9.19,Google_App_Engine_SDK_for_Python,GAE Python上传工具。
GAE使用规则GAE使用规则GAE使用规则GAE使用规则GAE使用规则GAE使用规则GAE使用规则GAE使用规则GAE使用规则
pass之GAE入门教程, 学习GAE
python库。 资源全名:appfy.recipe.gae-0.7.1.zip
图自编码器GAE的pytorch实现,参考论文vgae
GAE平台开发应用时,简单的webapp框架的使用
《GAE编程指南》是一种云计算服务,跟其他的同类产品不同,它提供了一种简单的应用程序构建模型,通过这种模型,你可以轻松地构建出能够容纳数百万用户的应用程序。《GAE编程指南》是介绍使用这个强大平台的专家级...
Next you will get acquainted with the cloud computing concepts in Python, using Google App Engine (GAE), and building your first application with GAE. Lastly, you will learn about grid computing ...
图形自动编码器GAE的pytorch实现,可参考论文VGAE
ipv4一定会被v6代替,这本书可以学到ipv6的知识点,非常推荐!!