【问题标题】:How to send form data in httpsync - node.js?如何在 httpsync - node.js 中发送表单数据?
【发布时间】:2014-10-25 09:22:52
【问题描述】:

我正在使用httpSync 模块从服务器获取数据。

我有如下示例

var httpsync = require('httpsync');
var req = httpsync.request({
             url: url,
             method: "POST"
});

注意:

   I am using httpSync because i want the request to behave synchronous.

   I cannot add original code

如何使用httpSync 将表单数据发送到服务器

我尝试了以下方法,但它不起作用

  var req = httpsync.request({
             url: url,
             method: "POST"
             form:{a:1,b:1}
});

任何建议将不胜感激

【问题讨论】:

    标签: node.js http http-method


    【解决方案1】:

    httpsync 模块有一个例子。

    查看此链接

    https://github.com/fengmk2/node-curl/blob/master/example/upload_file.js

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-12-05
      • 2013-03-12
      • 2019-07-28
      • 2017-06-16
      • 1970-01-01
      • 2013-10-17
      • 2013-11-02
      • 1970-01-01
      相关资源
      最近更新 更多