form.html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" cnotallow="width=device-width, initial-scale=1.0"> <title>Document</title> </head> <body> <form actinotallow="http://localhost:8887/aaa" method="GET"> 用户名:<input type="text" name="username"> 密码:<input type="password" name="password"> <input type="submit" value="提交"> </form> </body> </html>demo7.js let http = require('http') let url = require('url'); http.createServer((req,res)=>{ console.log(req.url); let{pathname,query}=url.parse(req.url,true) //console.log(url.parse(req.url,true)) console.log(pathname.query); }).listen(8887)