http模块
来源:互联网 发布:淘宝运费设置技巧 编辑:程序博客网 时间:2024/05/22 06:52
var http = require("http");var items = [];http.createServer((req,res)=>{ switch (req.method){ case "POST": var item = ""; req.on("data",(chunk)=>{ item += chunk; }); req.on("end",()=>{ items.push(item); items.forEach((e)=>{res.write(e)}); res.end(); }) break; case "GET": var body = items.map((item,i)=>{ return i + ")" + item; }); res.setHeader("Content-Length",Buffer.byteLength(body)); res.setHeader("Content-Type","text/plain;charset='utf8'"); res.end(body); break; default: res.end("404 not found"); break; };}).listen(4002);
阅读全文
0 0
- http模块
- http模块
- nginx http模块 http过滤模块
- (轉)HTTP 模块介绍
- Subtext--HTTP 模块
- HTTP模块(1)
- Nginx Http模块开发
- python http client模块
- 自定义 HTTP 模块
- Nginx Http模块开发
- nginx---HTTP模块
- Http开发模块
- Nodejs http、url模块
- nginx HTTP模块组成
- nodejs模块-http
- Node.js12 Http模块
- http模块初始化过程
- 编写http模块
- IE下setInterval()失效问题
- Sicily 1936. Knight Moves
- BinaryConnect: Training Deep Neural Networks with binary weights during propagations
- 合唱队形(简单的动规)
- 机器学习中常见分类器的应用场景
- http模块
- qt安装包下载地址
- 通过diff及patch制作使用补丁
- log4j.properties配置详解与实例
- ICMP
- ストアドプロシージャ
- Build a Backend For Frontend (BFF) app in Predix
- Unity常用脚本API
- opengl绘制四边形