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的更多相关文章

  1. [转]第四章 使用OpenCV探测来至运动的结构——Chapter 4:Exploring Structure from Motion Using OpenCV

    仅供参考,还未运行程序,理解部分有误,请参考英文原版. 绿色部分非文章内容,是个人理解. 转载请注明:http://blog.csdn.net/raby_gyl/article/details/174 ...

  2. Exploring the Angular 1.5 .component() method

    Angular 1.5 introduced the .component() helper method, which is much simpler than the.directive() de ...

  3. [翻译.每月一译.每日一段]Exploring Fonts with DirectWrite and Modern C++

    Windows with C++ Exploring Fonts with DirectWrite and Modern C++ Kenny Kerr DirectWrite is an incred ...

  4. Exploring Python Code Objects

    Exploring Python Code Objects https://late.am/post/2012/03/26/exploring-python-code-objects.html Ins ...

  5. Exploring refit, an automatic type-safe REST library for .NET Standard

    自动类型安全的.NET标准REST库refit   在SCOTT HANSELMAN 博客上看到一个好东西<Exploring refit, an automatic type-safe RES ...

  6. [NLP] cs224n-2019 Assignment 1 Exploring Word Vectors

      CS224N Assignment 1: Exploring Word Vectors (25 Points)¶ Welcome to CS224n! Before you start, make ...

  7. ECMAScript 5 新增 Object 接口

    对象 构造器 说明 Object getPrototypeOf 返回对象的原型 Object getOwnPropertyDescriptor 返回对象自有属性的属性描述符 Object getOwn ...

  8. CoreCLR源码探索(一) Object是什么

    .Net程序员们每天都在和Object在打交道 如果你问一个.Net程序员什么是Object,他可能会信誓旦旦的告诉你"Object还不简单吗,就是所有类型的基类" 这个答案是对的 ...

  9. JavaScript Object对象

    目录 1. 介绍:阐述 Object 对象. 2. 构造函数:介绍 Object 对象的构造函数. 3. 实例属性:介绍 Object 对象的实例属性:prototype.constructor等等. ...

随机推荐

  1. android开发 获取父控件的高宽

    @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(wi ...

  2. 基于word制作网站webhelp

    处理问题描述:现在我有个javaweb项目,需要在portal上面点击help即可打开: 当前搜索百度(谷歌不能用了),没有找到更好的解决方案,自己想了个比较简单实用的方法,仅供参考: 设计原理:利用 ...

  3. [原创] zabbix学习之旅二:yum安装

    对于允许连接公网的环境下,显然通过yum安装是最为简单方便的,也是官网推荐的安装方式.通过这种方式安装,会将php.apache.zabbix本身都一并安装,解决了烦人的依赖包问题.   本文将介绍如 ...

  4. 自定义异常时如何定义checked异常和unchecked异常

    When defining your own exception type, study the existing exception classes in the Java API and try ...

  5. 【BZOJ】【3856】Monster

    又是一道水题…… 重点是分情况讨论: 首先我们很容易想到,如果a*k-b*(k+1)>0的话那么一定能磨死Monster. 但即使不满足这个条件,还有可能打死boss: 1.h-a<1也就 ...

  6. 【CoreData】parent-child关系ManagedObjectContext应用

    当我们一开始使用CoreData框架和唯一的MOC进行应用的数据持久化的时候,如果创建项目的时候选择了“使用CoreData”,这会是XCode自动生成的模板代码的样子. 同时,配合NSFetched ...

  7. uiwebview和 js交互框架

    WebViewJavascriptBridge

  8. 高达渐出现效果Shader

    原地址: http://liweizhaolili.blog.163.com/blog/static/1623074420140591864/ 最近在玩游戏<高达破坏者>,里面的高达出现的 ...

  9. Extjs利用vtype验证表单

    Ext.create('Ext.form.Panel', {         title: '表单验证',         renderTo: Ext.getBody(),         frame ...

  10. C#&java重学笔记(函数)

    C#部分  1.写在函数定义的()中的关键字: a.params关键字:用来满足函数的参数为数组时,而数组的长度不固定的情况.且该关键字只能用来修饰数组型参数.这样一修饰,就达成了类似JavaScri ...