首页 > 其他 > 详细

request对象的方法

时间:2019-12-22 19:10:00      阅读:83      评论:0      收藏:0      [点我收藏+]

request对象的方法

request.method  # 请求方法 GET POST 
request.GET     # url上携带的参数  {}  
request.POST   # form提交POST请求的参数  {}   编码类型是urlencode 
request.body   # 请求体  b''
request.path_info  # 路径  不包含ip和端口  也不包含参数
request.COOKIES  # cookie的字典 
request.session  # session的数据
request.FILES  # 上传的文件  编码的类型是  enctype="multipart/form-data"
request.META     # 请求头   小写 ——》 大写  HTTP_    - _> _

request.get_full_path()   # 路径  不包含ip和端口  包含参数
request.get_signed_cookie(key)  # 获取加密cookie
request.is_ajax()   # 是否是ajax

request对象的方法

原文:https://www.cnblogs.com/-xct/p/12080622.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!