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 ...
随机推荐
- CentOS系统rsync文件同步 安装配置
rsync是类unix系统下的数据镜像备份工具,从软件的命名上就可以看出来了——remote sync 它的特性如下: 可以镜像保存整个目录树和文件系统. 可以很容易做到保持原来文件的权限.时间.软硬 ...
- js控制网页滚动条往下滚动
function aa(i){ var tm = setInterval(function(){ var t = $(window).scrollTop(); , -) : Math.max((i-t ...
- Session的SqlServer模式的配置
很多时候,由于各种莫名其妙的原因,会导致session丢失.不过ASP.NET还允许将会话数据存储到一个数据库服务器中,方法是将mode属性变成SqlServer. 在这种情况下,ASP.NET尝试将 ...
- 异步编程中的最佳做法(async await)
阅读1:http://blog.csdn.net/nacl025/article/details/9163495 阅读2:http://www.cnblogs.com/x-xk/archive/201 ...
- C# 正则匹配domain
1.带协议表达式 var pattern = @"[(?<=http://)|(?<=https://)]+[\w\.]+[^/?#]"; 2.不带协议表达式 var ...
- Bootstrap学习------Tabel
Bootstrap的表格和Html表格大同小异,只是封装了一些css供我们使用 <table>标签必须引用class="table"基类样式,我们可以根据需求赛选需要的 ...
- Storm:最火的流式处理框架
伴随着信息科技日新月异的发展,信息呈现出爆发式的膨胀,人们获取信息的途径也更加多样.更加便捷,同时对于信息的时效性要求也越来越高.举个搜索场景中的例子,当一个卖家发布了一条宝贝信息时,他希望的当然是这 ...
- linux 关机命令总结
linux下常用的关机命令有:shutdown.halt.poweroff.init:重启命令有:reboot.下面本文就主要介绍一些常用的关机命令以及各种关机命令之间的区别和具体用法. 首先来看一下 ...
- GOF业务场景的设计模式-----工厂模式
定义:定义一个用于创建对象的接口,让子类决定实例化哪一个类,工厂方法使一个类的实例化延迟到其子类. 工厂方法模式 基本代码 interface IProduct { public void produ ...
- ExtJS请求验证方法
//登录连接数据库验证 function loginCheck() { var UserName = Ext.getCmp("UserName").getValue(); var ...