tornado RequestHandler request.body & request.arguments
request.body , 请求的原始内容,post方式放在body中的。
request.arguments, body参数和url参数的统一体, 同时也是经过“加工”,解码的。
eg.在对接其他平台时,对方可能post过来的body内容是这样的:
———————————————2b556c28ca53
Content-Disposition: form-data; name="order_number" LT40OQ95A5N67
———————————————2b556c28ca53
Content-Disposition: form-data; name="shipping_status" 5
———————————————2b556c28ca53
Content-Disposition: form-data; name="shipping_status_desc" 充值失败
———————————————2b556c28ca53
Content-Disposition: form-data; name="shipping_status_message" ———————————————2b556c28ca53———————————————
这就是所谓的“原始内容”, 可以自己split。
然而更简单的方式是直接用request.arguments读取(以上内容可以很愉快的得到一个json字符串)。
转载请注明来源:http://www.cnblogs.com/Tommy-Yu/p/5715853.html
参考:http://stackoverflow.com/questions/34818996/tornado-what-is-the-difference-between-requesthandlers-get-argument-get-qu
tornado RequestHandler request.body & request.arguments的更多相关文章
- tornado requesthandler可以重写的方法
一 :RequestHandler 一般我们继承tornado.web.RequestHandler 1,RequestHandler.initialize()一般用于初始化,第三个字典参数传入 cl ...
- String path = request.getContextPath(); String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";作用!!!!!
<%String path = request.getContextPath();String basePath = request.getScheme()+"://"+re ...
- C#中 Request, Request.params , Request.querystring , Request.Form 区别 与联系用法
C#中 Request, Request.params , Request.querystring , Request.Form 区别 与联系用法? Request.params , Request ...
- basePath = request.getScheme()+"://"+request.getServerName()+":"+r
basePath = request.getScheme()+"://"+request.getServerName()+":"+r (2014-06-30 1 ...
- String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+pat----------<base>元素有关
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request. ...
- request.get request.GET……
发现他们是不同的. 报错: AttributeError at /add/ 'WSGIRequest' object has no attribute 'get' Request Method: GE ...
- 客户端的数据来源:QueryString, Form, Cookie Request[]与Request.Params[]
在ASP.NET编程中,有三个比较常见的来自于客户端的数据来源:QueryString, Form, Cookie . 我们可以在HttpRequest中访问这三大对象. QueryString: 获 ...
- JSP之项目路径问题(${pageContext.request.contextPath},<%=request.getContextPath()%>以及绝对路径获取)
本随笔这是作为一个记录使用,以备后查.项目完成之后本地部署OK,本地Linux部署OK,都可以正常的访问,可是当我把它部署到服务器上面的时候,首页可以正常访问,可是当发出请求的时候却报错误了,说找不到 ...
- 安卓开发笔记(十六):'Request(okhttp3.Request.Builder)' has private access in 'okhttp3.Request
当出现了'Request(okhttp3.Request.Builder)' has private access in 'okhttp3.Request的错误的时候,实际上是我们在写代码的时候少打了 ...
- <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %>
<%String path = request.getContextPath();String basePath = request.getScheme()+"://"+re ...
随机推荐
- DB服务器中的参数优化
1.swappiness 禁止系统使用swap空间,配置/etc/sysctl.conf中的vm.swappiness=0 2.Scheduler调度 Scheduler调度,指的是磁盘的IO调度算法 ...
- Unity3D PerRendererData
http://nordicedu.com/tkokblog/wordpress/?tag=perrendererdata MaterialPropertyBlock and SpriteRendere ...
- OSX10.11 删除系统自带的软件
之前一直用sudo rm - rf 系统的浏览器名字 正常删除safari 升级到10.11后,完全没作用了 需要关闭系统的什么安全模式 csrutil disable 再进入系统使用此命令可正常删除 ...
- 轻量级router[类似laravel router]
github地址:https://github.com/NoahBuscher/Macaw/blob/master/Macaw.php 代码加上一些注释,方便以后再看. <?php namesp ...
- AuthenticationManager.SignOut() 无法注销用户的问题
http://hadb.me/2015/03/23/authenticationmanager-signout-not-working/ 这文章不对, 我发现原因是不能有Response.Redire ...
- LevelDB库简介
LevelDB库简介 一.LevelDB入门 LevelDB是Google开源的持久化KV单机数据库,具有很高的随机写,顺序读/写性能,但是随机读的性能很一般,也就是说,LevelDB很适合应用在查询 ...
- jQuery -- is() 方法
定义和用法: 根据选择器.DOM元素或 jQuery 对象来检测匹配元素集合,如果其中至少有一个元素符合这个给定的表达式就返回true.如果没有元素符合,或者表达式无效,都返回'false'. ''' ...
- Python开发【第十八篇】:MySQL(二)
视图 视图是一个虚拟表(非真实存在),其本质是[根据SQL语句获取动态的数据集,并为其命名],用户使用时只需使用[名称]即可获取结果集,并可以将其当作表来使用. SELECT * FROM ( SEL ...
- Ubuntu 源码安装 nginx 1.9.2
安装前准备: //更新系统 1.sudo apt-get update //安装pcre包 2.sudo apt-get install libpcre3 libpcre3-dev 3.sudo ...
- Centos安装Kafka集群
kafka是LinkedIn开发并开源的一个分布式MQ系统,现在是Apache的一个孵化项目.在它的主页描述kafka为一个高吞吐量的分布式(能 将消息分散到不同的节点上)MQ.在这片博文中,作者简单 ...