request.get_full_path() 和request.path区别
1. 都是获取request 请求的url路径
2. request.get_full_path() -- 获取当前url,(包含参数)
请求一个http://127.0.0.1:8000/200/?type=10
request.get_full_path()返回的是【/200/?type=10】
request.path -- 获取当前url,(但不含参数)
request.path返回的是 【/200/】
3. 如果想让其正常显示(有中文的情况下),需进行如下编码处理【django 默认编码是unicode 的】
request.get_full_path().encode('utf-8') request.path.encode('utf-8')
转载于:https://www.cnblogs.com/robinunix/p/9182482.html
request.get_full_path() 和request.path区别相关推荐
- ASP.NET中Request.ApplicationPath、Request.FilePath、Request.Path、.Request.MapPath、Server.MapPath的区别
ASP.NET中Request.ApplicationPath.Request.FilePath.Request.Path..Request.MapPath.Server.MapPath的区别 1.R ...
- Request、Request.Form和Request.QueryString的区别
Request.Request.Form和Request.QueryString的区别 Request.Form:获取以POST方式提交的数据(接收Form提交来的数据): Request.Query ...
- python爬虫用urllib还是reques,python爬虫中urllib.request和requests有什么区别?
在学习python爬虫,想要检索request相关内容时,往往会出现urllib.request和requests这两个词,urllib.request和requests都是python爬虫的模块,其 ...
- request.getParameter和request.getAttribute之间的区别
HttpServletRequest类既有getAttribute()方法,也由getParameter()方法,这两个方法有以下区别: (1)HttpServletRequest类有setAttri ...
- request.getParameter()与request.setAttribute()的区别
request.getParameter(),request.setAttribute()区别如下: (1)request.getParameter()取得是通过容器的实现来取得通过类似post,ge ...
- Web应用中request获取各种获取path或URI,URL的方法
Web应用中有各种获取path或URI,URL的方法,假设网页访问地址: http://localhost:8080/tradeload/TestServlet Web应用context: /trad ...
- request.getParameter() 和request.getAttribute() 区别
request.getParameter() 和request.getAttribute() 区别 getParameter 是用来接受用post个get方法传递过来的参数的. getAttribut ...
- request.setAttribute()与getParameter() 的区别
request.setAttribute()与getParameter() request.getParameter(),request.setAttribute()区别如下: (1)reques ...
- 总结:request.setAttribute()、session.setAttribute()和request.getParameter()的联系与区别
1.session.setAttribute()和session.getAttribute()配对使用,作用域是整个会话期间,在所有的页面都使用这些数据的时候使用. 2.request.setAttr ...
- JSPServlet中request.getParameter() 和request.getAttribute() 区别
一.request.getParameter() 和request.getAttribute() 区别 (1)request.getParameter()取得是通过容器的实现来取得通过类似post,g ...
最新文章
- MySQL主从同步问题集
- 用 Flask 来写个轻博客 (22) — 实现博客文章的添加和编辑页面
- 编程练习--简单实用的选项卡切换效果
- [云炬创业学笔记]第三章商业创意的发掘与评估测试4
- C/Cpp / 参数传递时如何防止数组退化为指针
- c调用python第三方库_用 Python ctypes 来调用 C/C++ 编写的第三方库
- oracle10g密钥,Oracle10G透明数据加密技术如何使用呢?
- phpcms根据二级栏目列表写的三级栏目列表
- AJAX学习笔记 一:简单的XMLHTTPRequest示例和asp.net异步更新。
- 天线的回波损耗和驻波比
- excel删除无尽空白行_Excel 快速删除空白行
- 关于QtCreator中三种不同编译版本 debug、release、profile 的区别
- Django博客开发(十三)—一个简单的站内搜索
- 七月算法机器学习笔记4 凸优化
- matlab 拉布拉斯矩阵,关于图像处理:C ++中的拉普拉斯矩阵计算
- iPhone4S降级至iOS6
- Matlab帮助文档网址
- Python基于Opencv的鱼群密度速度检测系统(源码&教程)
- windows查看端口占用命令
- APP Inventor中如何利用GPS经纬度计算GPS距离、速度、方向