node.js获取httpurl路径中的各个参数.-创新互联
若url为:
![node.js获取httpurl
路径中的各个参数. node.js获取httpurl
路径中的各个参数.](/upload/otherpic16/2167602.jpg)
当前题目:node.js获取httpurl路径中的各个参数.-创新互联
链接URL:http://pcwzsj.com/article/cojhde.html
![node.js获取httpurl
路径中的各个参数. node.js获取httpurl
路径中的各个参数.](/upload/otherpic16/2167602.jpg)
http://localhost:8888/select?name=a&id=5
http.createServer(function(request,response){ var pathname = url.parse(request.url).pathname; //pathname => select var arg = url.parse(request.url).query; //arg => name=a&id=5 console.log("Request for " + arg ); var name = querystring.parse(arg).name; //name => a console.log("name = "+name); console.log("Request for " + pathname + " received."); }).listen(8888);
//querystring.parse(arg) => { name: 'a', id: '5' }
不登高山,怎知天高;不临深溪,焉知地厚!站在坚实的土地上,做着生命中最真实的事情;像一棵挺拔的大树,认可自己的命运并敢于迎接属于这一方天空的风风雨雨。当前题目:node.js获取httpurl路径中的各个参数.-创新互联
链接URL:http://pcwzsj.com/article/cojhde.html