Server将表单数据获取并返给Client
来源:互联网 发布:apache zip jar 编辑:程序博客网 时间:2024/05/12 03:24
var http =require('http');var querystring = require('querystring');http.createServer(function(req, res){ switch (req.url) { case '/form': if (req.method == 'POST') { console.log('[200] ' + req.method + " to" + req.url); var fullBody = ''; req.on('data', function(chunk){ fullBody += chunk.toString(); }); req.on('end', function(){ res.writeHead(200, 'OK', {'Content-Type':'text/html'}); res.write('<html><head><title>Post Data</title></head><body>'); var bodytt = querystring.parse(fullBody); for(var prop in bodytt) { res.write('<h5>' + prop + ':' + bodytt[prop] + '</h5>'); } res.write('</body></html>'); res.end(); }); } else { console.log('[405] ' + req.method + ' to ' + req.url); res.writeHead(405, "Method not supported", {'Content-Type':'text/html'}); res.end('<html><head><title>error 405</title></head><body>Method is not supported</body></html>'); } break; case '/index': default : res.writeHead(404, "Not Found Page", {'Content-Type':'text/html'}); res.end('<html><head><title>404 error</title></head><body>Page Is Not Found</body></html>'); console.log('[404] ' + req.method + " to " + req.url); }}).listen(8080, '127.0.0.1');
1 0
- Server将表单数据获取并返给Client
- Grails从表单获取数据并存储
- 通过 JS 实现与后台进行连接,提交表单,将获取到的数据pos给服务器。
- Struts2(二)---将页面表单中的数据提交给Action
- Struts2(二)---将页面表单中的数据提交给Action
- Struts2(二)---将页面表单中的数据提交给Action
- easyui怎么将前台表单数据传递给后台?
- Struts2(二)---将页面表单中的数据提交给Action
- 获取Iframe页面高度,并将高度赋值给Iframe
- smartupload实现文件上传 并获取表单数据
- Request向客户机输出表单,并获取数据
- html form表单提交数据并后台获取
- Django获取表单数据并从数据库查询
- html form表单提交数据并后台获取
- 使用javabean获取表单数据并进行计算
- jquery 序列化获取表单数据,并装入JSON数组
- 基于RXNetty client给server 发消息 获取回调方法
- soapUI获取数据表数据并向下传递给request
- Salient Object Detection and Segmentation
- 日志aop方式
- Sqoop
- Python装饰器真的只是语法糖吗?
- hdoj--3530 Subsequence(单调队列)
- Server将表单数据获取并返给Client
- Spring通过实现getBean方法获得Bean的实例
- Hibernate Annotation中BLOB、CLOB注解写法
- C#中如何申明固定长度的数组
- zookeeper
- 我是一名程序猿,我喜欢走在路上的感觉。
- Github for windows的使用
- 跟我一起学习MySQL技术内幕(第五版):(第二章学习日记13)
- Solr