node.js 模块之url和querystring模块
2014-09-03 22:24 youxin 阅读(369) 评论(0) 收藏 举报关系如下:
url.parse(string).query
|
url.parse(string).pathname |
| |
| |
------ -------------------
http://localhost:8888/start?foo=bar&hello=world
--- -----
| |
| |
querystring(string)["foo"] |
|
querystring(string)["hello"]
pathname不包括query string,
http://localhost:8888/start
的pathname为/start.注意有斜线。
访问http://localhost:8888
的pathname为/.
浙公网安备 33010602011771号