当前位置:网站首页>URL模块
URL模块
2022-08-02 03:22:00 【cjx177187】
可以把url网址解析为一个对象
var url =require("url")
var urlobj=url.parse(req.url)
console.log(req.url)
req.url是什莫?
是前端发送过来的网址===>协议,网址,端口,pathname,querystring
我们要通过打印的这个网址来判断我们接下来的逻辑是都正确。
举例:
重点使用的是pathname ,前端发送网址我们就可以利用这个属性来获取网址中的路径来读取文件;还有qurey,可以用来获取数据,他将字符串截取变更保存到一个对象中,这对后序我们使用和修改这些数据提供了便利。
边栏推荐
- Debian 10 NTP Service Configuration
- np.isnan ()
- 最新,每天填坑,Jeston TX1 精卫填坑,第一步:刷机
- 【 application 】 life many years of operations, what turned scored 12 k + annual bonus salary?
- sh: 1: curl: not found
- Week 7 Review
- MySQL常见的索引
- C语言 内联函数
- The difference between the knowledge question and answer session with the knowledge
- Phospholipid-polyethylene glycol-azide, DSPE-PEG-Azide, DSPE-PEG-N3, MW: 5000
猜你喜欢
PCL—point cloud data segmentation
Phospholipid-polyethylene glycol-thiol, DSPE-PEG-Thiol, DSPE-PEG-SH, MW: 5000
2022年比若依更香的开源项目
磷脂-聚乙二醇-叠氮,DSPE-PEG-Azide,DSPE-PEG-N3,MW:5000
Redis简单学习笔记
【装机】老毛桃的安装及使用
Week 7 Review
Phospholipid-polyethylene glycol-targeted neovascularization targeting peptide APRPG, DSPE-PEG-APRPG
Deveco studio 鸿蒙app访问网络详细过程(js)
HCIP-第十天-BGP综合实验
随机推荐
啃瓜记录又一天
【面试】失败的一次面试
mysql创建表
Redis笔记基础篇:6分钟看完Redis的八种数据类型
基本运算符
ThunderBirde无法登录问题、pycharm调试一直收集数据、RuntimeError: CUDA error: device-side assert triggered等疑难杂症解决
3 minutes to take you to understand WeChat applet development
redis进行持久化时,有新的写操作将如何解决——写时复制
亚马逊卖家怎么提升转化率
Cloud server installation and deployment of Nacos 2.0.4 version
oracle inner join and outer join
DSPE-PEG-Silane,DSPE-PEG-SIL,磷脂-聚乙二醇-硅烷修饰活性基团
Problems when yolov5 calls ip camera
DSPE-PEG-Silane, DSPE-PEG-SIL, phospholipid-polyethylene glycol-silane modified active group
PCL—point cloud data segmentation
2022年比若依更香的开源项目
Debian 10 NTP 服务配置
跨域问题解决
Deveco studio Hongmeng app access network detailed process (js)
The usage of json type field in mysql