简体   繁体   English

Node.js POST请求不起作用

[英]Node.js POST request not working

My parameters in Node-Request aren't getting to its target... I'm not finding any mistakes... 我在Node-Request中的参数没有达到目标...我没有发现任何错误...

      var data = querystring.stringify({
      image: 'test',
      test: 'testitest'
  });

  var options = {
      host: 'www.visionalism.com',
      path: path,
      method: 'POST'
  };

var photo_req = http.request(options, function(response) {
    response.setEncoding('utf8');
    response.on('data', function (chunk) {
        console.log("body: " + chunk);
    });
});
  console.log(data);
photo_req.write(data);
photo_req.end();

At the other side, the POST array (php) is complete empty... 在另一边,POST阵列(PHP)是完全空...

Am i missing anything? 我有什么想念的吗?

通过添加标题解决了这个问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM