node.js - node发post请求参数过长
大家讲道理
大家讲道理 2017-04-17 15:27:28
0
2
677
request.post( urlstr )
    .set('Content-Type', 'application/x-www-form-urlencoded')
    .send(da)
    .end(function(err, res){
        if (!err) {
            console.log(res.body)
            callback(res.body);
        }else{

        };
        
    })
if (this.config.obj.productInfo) {
        this.config.obj.productInfo =  encodeURI( this.config.obj.productInfo );
    };
    var bodyQueryStr = this.config.obj;
    

    var da = '';

    for (var a in bodyQueryStr) {
        da += a +'='+ bodyQueryStr[a] + '&';
    };

使用SuperAgent发post请求 当参数过长时 失效了 什么原因呢 和 application/x-www-form-urlencoded 有关系吗

大家讲道理
大家讲道理

光阴似箭催人老,日月如移越少年。

reply all(2)
黄舟

What about splitting an object into multiple single key-value pairs?

小葫芦
app.use(bodyParser({
  limit: 2000000  //2m
}));

With this setting, you can modify the limit size, transfer images, and your fields should be enough

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!