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

  • 相关阅读:
    JS和C#对Json的操作
    JS图形化插件利器组件系列 —— Gojs组件
    Android APK反编译 apktool使用教程
    UML系列图
    多线程学习 ---- 系列教程
    大型网站架构之系列
    经典算法题锦集
    基本算法系列15天速成
    居转户--相关信息
    使用C#创建Windows服务
  • 原文地址:https://www.cnblogs.com/Tommy-Yu/p/5715853.html
Copyright © 2011-2022 走看看