#-*-coding:utf-8-*-

importweb
importjson

urls=("/.*","index")
app=web.application(urls,globals())

classindex:
"""
Server:Apache-Coyote/1.1
Pragram:no-cache
Cache-Control:no-cache,no-store,max-age=0
Expires:Thu,01Jan197000:00:00GMT
Content-Type:application/json;charset=UTF-8
Content-Language:zh-CN
Transfer-Encoding:chunked
"""
defGET(self):
res='你好中国'
#a=res.decode('utf8')
#b=a.encode('gb2312')
web.header('content-type','application/json;chartset=UTF-8')
returnres

defPOST(self):
web.header('content-type','application/json;chartset=UTF-8')
web.header('Server','Webpy')
web.header('Content-Language','zh-CN')
web.header('Pragram','no-cache')
web.header('Cache-Control','no-cache,no-store,max-age=0')

#res={
#"code":0,
#"msg":"success",
#"data":{"table":[{"id":"1","name":"世界上最美的花","fileUrl":"/home/STE-test/Testdata/世界上最美的花.mp3"},
#{"id":"5","name":"夏洛特烦恼","fileUrl":"/home/STE-test/Testdata/夏洛特烦恼.mp3"}
#]
#}
#}
res={"code":0,"msg":"success","data":{"isPlay":1,"duration":3589,"totalTime":3600}}
j_res=json.dumps(res)

returnj_res

if__name__=="__main__":
app.run()

最新文章

  1. gong server
  2. LVS简介
  3. python 数据加密以及生成token和token验证
  4. 2016 CCPC 杭州站 小结
  5. (7)如何得到所有的 "水仙花数" ?
  6. /export/App/zz/phantomjs-1.9.7-linux-x86_64/bin
  7. cocos2dx 在windows上实现键盘输入
  8. android学习17——命令行建gradle工程
  9. 【转】 Python subprocess模块学习总结
  10. Django框架(二)
  11. Python3实战系列之七(获取印度售后数据项目)
  12. JAVA的初始化顺序:
  13. 十 suprocess模块
  14. am start的总结,-d参数的总结,以及python中传递内容包含中文及特殊字符&的解决方案
  15. PHP 传值操作和传地址操作
  16. C#操作共享文件夹
  17. [GO]用go语言实现区块链工作原理
  18. 【WXS全局对象】Date
  19. java 搭建web项目
  20. project 的用法

热门文章

  1. kubernetes之pod调度
  2. Linux入门基础
  3. ARM体系结构与编程读书笔记——处理器的寄存器
  4. Monit-开源服务器监控工具
  5. golang struct的使用
  6. HashMap源码分析二
  7. Hbuilder 开发微信小程序的代码高亮
  8. CSP-S2019 退役记/赛后总结
  9. np中的随机函数
  10. jmeter-post请求自动变成get,提示请求方式错误,修改协议即可