注意:最后加上end(),否则请求发不出去。切记!!!
const http = require('http');console.log('http');http.request({host: 'localhost',port: 3000,path: '/login?name=lisi&pwd=123'}, (response) => {//不断更新数据let body = '';response.on('data',(data) => {body += data;});response.on('end',() => {//数据接收完成console.log(body);});}).end();
