
首先获取>
写一个html5网页,这个网页中的内容如下面所示,目标是获取这个表单中的name 和age数据,action是服务器地址和端口,文件名indexhtml
可以用浏览器来打开这个端口,如下图中所示,对浏览器无要求,基本上常用的浏览器都可以打开
在命令行中运行服务,node appjs,然后在第三步中的html页面上点击提交按钮。这时命令行中的显示如下,这样就得到了表单中post的数据,完成了html中数据从前端到后台的过程
同时 网页跳到如下所示
下面这里贴上测试代码
////////////////appjs///////
var >
var server = >
if(requrl!=="/faviconico"){
reqon('data',function(data){
consolelog("服务器接收到的数据: "+decodeURIComponent(data));
});
reqon("end",function(){
consolelog('客户端请求数据全部接收完毕');
});
}
resend();
})listen(1337,"localhost",function(){
consolelog("listened");
});
////////////////indexhtml///////
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Nodejs的data事件与end事件的回调函数测试用页面</title>
</head>
<body>
<form id= "form1" action = ">
姓名:<input type = 'text' name = "name" value ="dragon"><br/>
年龄:<input type = "number" name = "age" value ="25">
<input type = "submit" value =" 提交"/>
</form>
</body>
</html>
以上就是关于Https详解+wireshark抓包演示全部的内容,包括:Https详解+wireshark抓包演示、https证书问题、FormData对象被传到Server端,Server怎样提取其中的数据等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)