

后来发现是请求头设置的问题,发送选项中需要加上headers字段信息(这个估计也和对方的服务器有关,对于不完成的post请求头,可能被丢弃了)。
完整的代码如下(遇到类型问题的同学可以做个参考):
 代码如下:
var querystring = require('querystring')
 , http = require('http');
var data = querystring.stringify({
 info:'hi',
 test:5
});
var opt = {
 hostname:'www.test.com',
 port :9094,
 path:'/perationSqlQuery',
 method: 'POST',
 headers: { 
 'Content-Type':'application/x-www-form-urlencoded',
 'Content-Length': data.length 
 } 
};
var req = http.request(opt, function (res) { 
 res.on('data', function (data) {
 console.log(data.toString());
 });
});
req.on('error', function(e) {
 console.log('problem with request: ' + e.message);
});
req.write(data);
req.end();
 
