@Wangww0925
2019-08-07T08:03:07.000000Z
字数 447
阅读 188
NodeJs
var http = require("http");
var url = require("url");
http.createServer((req,res)=>{
console.log(req.url);
console.log(url.parse(req.url).pathname);
}).listen(8081);
/detail?fff
/detail
req.url() 带参数
url.parse(req.url).pathname 不带参数
req.url() 与 url.parse(req.url).path 一致
作者 wendy
2019 年 1月 21日