0

我正在尝试使用以下节点/快速功能在体式中发布任务

exports.addTask = function(req, res) {
  var url ='/api/1.0/tasks?workspace=' + req.session.workspace_id
  var postBase = "app.asana.com";
  var options = {
    host: postBase,
    port: 443,
    path: url,
    method: 'POST',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
      'Authorization': 'Bearer ' + JSON.parse(req.session.user).access_token,
    }
  };
  var req2 = https.request(options, function(res2) {
    res2.on('data', function(chunk) {
      console.log(chunk + "");
    });
    res2.on('error', function(e){
      console.log(e.message);
    });
  });

  req2.end();
}

我从体式得到正确的回应,即:

{"data":{"id":8253508011735,"created_at":"2013-10-20T16:17:53.140Z","modified_at":"2013-10-20T16:17:53.140Z","name":"","notes":"","completed":false,"assignee_status":"upcoming","completed_at":null,"due_on":null,"workspace":{"id":1361701377437,"name":"getspur.com"},"assignee":null,"parent":null,"followers":[{"id":1050147548705,"name":"Gorkem Yurtseven"}],"projects":[],"tags":[]}}

但我的体式任务中似乎没有添加任何内容..

附言。我目前正在纽约的 Facebook Hackathon 参加,所以加油!

4

1 回答 1

1

这可能是因为受让人为空,并且它不在任何项目中 - 这基本上使得它无法找到(除了可能通过搜索?)

没有看到帖子正文,我不确定这是故意的还是格式问题。

于 2013-11-06T14:47:58.180 回答