<commit_before>var express = require('express');
var querystring = require('querystring');
var bodyParser = require('body-parser');
var app = express();
//使用这个中间件之后，此中间件会把请求体转成对象赋给req.body
app.use(bodyParser.json());
//表示此路由会接收post方法
/*app.post('/reg',function(req,res){
    //
    req.body = '';//name=zfpx&age=7
    req.on('data',function(data){
        req.body += data;
    });
    req.on('end',function(){
        req.body = querystring.parse(req.body);
        console.log(req.body);
        res.send(req.body);
    });
});*/
app.post('/reg',function(req,res){
    console.log(req.body);
    res.send(req.body);
});
<commit_msg>页签 切换效果<commit_after>var express = require('express');
var querystring = require('querystring');
var bodyParser = require('body-parser');
var app = express();
//使用这个中间件之后，此中间件会把请求体转成对象赋给req.body
//它会处理请求头中content-type= application/json请求
app.use(bodyParser.json());
//extended为true时候会用node自带的querystring 把查询字符串转成对象
// false的时候，会用bodyParser自己写的转换函数
//它会处理请求头中content-type=application/x-www-form-urlencoded请求
app.use(bodyParser.urlencoded({extended:true}));
app.post('/reg',function(req,res){
    console.log(req.body);
    res.send(req.body);
});
//表示此路由会接收post方法
/*app.post('/reg',function(req,res){
    //
    req.body = '';//name=zfpx&age=7
    req.on('data',function(data){
        req.body += data;
    });
    req.on('end',function(){
        req.body = querystring.parse(req.body);
        console.log(req.body);
        res.send(req.body);
    });
});*/


{'fraction_non_alphanumeric': 0.19786096256684493, 'fraction_numerical': 0.001336898395721925, 'mean_word_length': 3.924342105263158, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1158170', 'n_tokens_mistral': 601, 'n_tokens_neox': 618, 'n_words': 66}