Curl Meteor.http.post对bitbucket的请求

Curl Meteor.http.post对bitbucket的请求,curl,meteor,Curl,Meteor,我必须在bitbucket中创建问题,我使用curl作为: curl --user {accountname}:{password} https://bitbucket.org/api/1.0/repositories/{accountname}/{repo_slug}/issues/ --data "title=some title" 但是我不知道如何在Meteor.http.post中发送请求,就像我将其作为 Meteor.http.post(https://bitbucket.o

我必须在bitbucket中创建问题,我使用curl作为:

curl --user {accountname}:{password} https://bitbucket.org/api/1.0/repositories/{accountname}/{repo_slug}/issues/ --data "title=some title"
但是我不知道如何在Meteor.http.post中发送请求,就像我将其作为

    Meteor.http.post(https://bitbucket.org/api/1.0/repositories/{accountname}/{repo_slug}/issues/, {auth: {accountname}:{password}, data: "title=some title"}, function(error,result){
      console.log(result);
    });
我得到的错误是

Error: failed [400] <ul class="errorlist"><li>title<ul class="errorlist"><li>This field is required.</li></ul></li></ul>
错误:失败[400]
  • 标题
    • 此字段为必填字段。
请告诉我如何以meteor格式编写curl代码的正确方向。

尝试呼叫:

   Meteor.http.post(https://bitbucket.org/.../,{auth: {accountname}:{password}, 
     data: {title: "some title"}, function(error,result){
      console.log(result);
   });
我认为您的设置不正确
数据
字段。

也许应该是这样

Meteor.http.post('https://bitbucket.org/api/1.0/repositories/{accountname}/{repo_slug}/issues/', {auth: {accountname}:{password}, data: "title=some title"}, function(error,result){
  console.log(result);
});