node的Get表单提交
form.html
Document
04.js
var http = require("http");var url = require("url");var server = http.createServer(function(req,res){ var queryObj=url.parse(req.url,true).query; var name=queryObj.name; var age=queryObj.age; var sex=queryObj.sex; res.writeHead(200,{"Content-type":"text/html;charset=UTF-8"}); res.end("服务器收到表单提交"+name+age+sex);});server.listen(3000,"127.0.0.1");
效果: