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 ...
随机推荐
- HTML 个人资料框
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
- cannot start session without errors
访问phpmyadmin出现如标题错误,解决方案如下: cd /var/lib/php 更改目录权限chown nginx:nginx -R session/ That's All!
- css 网站变灰色
网站变灰色 html{ -webkit-filter: grayscale(%); -webkit-filter: grayscale(); filter: grayscale(%); filter: ...
- Java继承和多态实例
我们知道面向对象的三大特性是封装.继承和多态.然而我们有时候总是搞不清楚这些概念.下面对这些概念进行整理, 为以后面向抽象的编程打下坚实的基础. 封装的概念还是很容易理解的.如果你会定义类,那么相信你 ...
- centos 安装php7.0.2
PHP7.0正式版已经在2015年11月份左右发布,目前是PHP7.0.2版本,本人最早是从2015年8月php7的第一个测试版跟起,现在正式版发布. linux版本:64位CentOS 6.6 Ng ...
- Linq to sql 的语法
Linq to SQL 语法查询(子查询 & in操作 & join ) 引用地址:http://www.cnblogs.com/82767136/articles/2949541.h ...
- 第二章平稳时间序列模型——ACF和PACF和样本ACF/PACF
自相关函数/自相关曲线ACF AR(1)模型的ACF: 模型为: 当其满足平稳的必要条件|a1|<1时(所以说,自相关系数是在平稳条件下求得的): y(t)和y(t-s)的 ...
- jquery datagrid加载后仅选定第一行
function onLoadSuccess(data) { var rows = $("#DataGrid").datagrid("getRows"); if ...
- 关于Tchar
因为C++支持两种字符串,即常规的ANSI编码(使用""包裹)和Unicode编码(使用L""包裹),这样对应的就有了两套字符串处理函数,比如:strlen和w ...
- 使用type="redirect"重定向,传递List等变量到jsp页面的问题
Struts2在提交表单的时候,使用「type="redirect"」重定向到相应的jsp页面. Action中的List表单是无法传到相应的jsp页面. 我猜测是因为List作为 ...