摘要:
一、 //引入模块 const http = require('http'); //创建服务 const server = http.createServer(function(req,res){ //request 请求 //response 响应 输出 //console.log('人来了'); 阅读全文
posted @ 2018-10-19 16:22
zhu6688
阅读(127)
评论(0)
推荐(0)
摘要:
1. get方式 const http = require('http') http.createServer((req,res)=>{ //console.log(req.url); 通过地址查看是否有传过来的数据信息 // /?user=1&pass=2 有信息 // /favicon.ico 阅读全文
posted @ 2018-10-19 10:29
zhu6688
阅读(170)
评论(0)
推荐(0)
摘要:
一、querystring模块 解析键值对形式的字符串为对象格式 // 1. 引入模块 const querystring = require('querystring'); let str = 'user=xiaoming&age=12'; let obj = querystring.parse( 阅读全文
posted @ 2018-10-19 10:03
zhu6688
阅读(87)
评论(0)
推荐(0)