zoukankan      html  css  js  c++  java
  • 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

  • 相关阅读:
    图像轮廓最大内接矩形的求法
    python利用sift和surf进行图像配准
    Faster Rcnn随笔
    opencv利用svm训练
    灰度图片均衡化源码
    彩色直方图(源码)
    Tensorflow内存暴涨问题
    C++写入txt
    C++生成dll以及调用(函数)和类
    列表元素的几种统计方法总结(嵌套列表)
  • 原文地址:https://www.cnblogs.com/Tommy-Yu/p/5715853.html
Copyright © 2011-2022 走看看