exploring the http Object
form.html
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<form action="" method="post">
<input type="text" name="userinput1">
<input type="text" name="userinput2">
<input type="submit">
</form>
</body>
</html>
server.js
var http=require("http");
var querystring=require("querystring");
var util=require("util");
var form=require("fs").readFileSync("form.html");
http.createServer(function(request,response){
if (request.method==="POST") {
var postData="";
request.on('data',function(chunk){
postData+=chunk;
}).on("end",function(){
var postDataObject=querystring.parse(postData);
console.log("User Posted:\n",postData);
response.end("You Posted:\n"+util.inspect(postDataObject));
});
}
if (request.method==="GET") {
response.writeHead(200,{"Content-Type":"text/html"});
response.end(form);
}
}).listen(8080);
运行:hotnode server.js
exploring the http Object的更多相关文章
- [转]第四章 使用OpenCV探测来至运动的结构——Chapter 4:Exploring Structure from Motion Using OpenCV
仅供参考,还未运行程序,理解部分有误,请参考英文原版. 绿色部分非文章内容,是个人理解. 转载请注明:http://blog.csdn.net/raby_gyl/article/details/174 ...
- Exploring the Angular 1.5 .component() method
Angular 1.5 introduced the .component() helper method, which is much simpler than the.directive() de ...
- [翻译.每月一译.每日一段]Exploring Fonts with DirectWrite and Modern C++
Windows with C++ Exploring Fonts with DirectWrite and Modern C++ Kenny Kerr DirectWrite is an incred ...
- Exploring Python Code Objects
Exploring Python Code Objects https://late.am/post/2012/03/26/exploring-python-code-objects.html Ins ...
- Exploring refit, an automatic type-safe REST library for .NET Standard
自动类型安全的.NET标准REST库refit 在SCOTT HANSELMAN 博客上看到一个好东西<Exploring refit, an automatic type-safe RES ...
- [NLP] cs224n-2019 Assignment 1 Exploring Word Vectors
CS224N Assignment 1: Exploring Word Vectors (25 Points)¶ Welcome to CS224n! Before you start, make ...
- ECMAScript 5 新增 Object 接口
对象 构造器 说明 Object getPrototypeOf 返回对象的原型 Object getOwnPropertyDescriptor 返回对象自有属性的属性描述符 Object getOwn ...
- CoreCLR源码探索(一) Object是什么
.Net程序员们每天都在和Object在打交道 如果你问一个.Net程序员什么是Object,他可能会信誓旦旦的告诉你"Object还不简单吗,就是所有类型的基类" 这个答案是对的 ...
- JavaScript Object对象
目录 1. 介绍:阐述 Object 对象. 2. 构造函数:介绍 Object 对象的构造函数. 3. 实例属性:介绍 Object 对象的实例属性:prototype.constructor等等. ...
随机推荐
- xml基础学习笔记04
今天继续xml学习,主要是:SimpleXML快速解析文档.xml与数组相互转换 .博客中只是简单的做一个学习记录.积累.更加详细的使用方法,可以查看php手册 1.SimpleXML快速解析文档 前 ...
- 在Action中以Struts2的方式输出JSON数据
参考地址;http://blog.csdn.net/itdada/article/details/21344985
- hdu 3123 GCC 阶乘
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3123 The GNU Compiler Collection (usually shortened t ...
- 【转载】CreateProcess的用法
第一.第二个参数的用法: 例子: 使用ie打开指定的网页. 注意第二个参数是 可执行文件+命令行参数 #include "stdafx.h" #include <window ...
- 3-Highcharts曲线图之显示点值折线图
直接上代码 根据代码注释讲解 <!DOCTYPE> <html lang='en'> <head> <title>3-Highcharts曲线图之显示 ...
- Metasploit命令大全
Metasploit是一款开源的安全漏洞检测工具,可以帮助安全和IT专业人士识别安全性问题,验证漏洞的缓解措施,并管理专家驱动的安全性进行评估,提供真正的安全风险情报.这些功能包括智能开发,密码审计, ...
- 用fabric部署维护kle日志收集系统
最近搞了一个logstash kafka elasticsearch kibana 整合部署的日志收集系统.部署参考lagstash + elasticsearch + kibana 3 + kafk ...
- ASP.NET Web.Config配置数据库连接的一种方法
所谓的webConfig配置数据库连接就是在里面某个特定名称的节点中写下ADP.NET中的ConnectString,就这么简单 1.首先在Web.Config文件里写下数据库连接字符串. <c ...
- Sql调用WebService
DECLARE @scid int,@rt int ) --创建MSSOAP.SoapClient组件(如果安装的是SoapToolkit30,应该是MSSOAP.SoapClient30,否则是MS ...
- UVALive6571 It Can Be Arranged(最小路径覆盖)
题意:现在有n个课程,每个课程有一定的参与人数,然后每个课程有开始时间和结束时间ai,bi. 而且给定了一个矩阵clean(ij),表示的是上完i课程需要clean[i][j]的时间打扫卫生才能继续上 ...