客户端和服务器上相同的HTTP.post在Meteor中给出不同的结果

客户端和服务器上相同的HTTP.post在Meteor中给出不同的结果,http,meteor,oauth,http-error,http-status-code-400,Http,Meteor,Oauth,Http Error,Http Status Code 400,我正在做一个OAuth,grant\u type设置为password(这意味着,我只能做这个客户端)。代码非常简单 HTTP.post(`${api}/token`, { params: { grant_type: 'password', client_id: 'some_id', client_sectet: 'some_secret', username: 'username', password: 'password' } }, (e, r

我正在做一个OAuth,
grant\u type
设置为
password
(这意味着,我只能做这个客户端)。代码非常简单

HTTP.post(`${api}/token`, {
  params: {
    grant_type: 'password',
    client_id: 'some_id',
    client_sectet: 'some_secret',
    username: 'username',
    password: 'password'
  }
}, (e, r) => {
  if (e) {
    console.error(e);
  } else {
    console.log(r);
  }
});
在流星壳中。i、 e.在服务器上,按原样执行代码,OAuth服务器返回带有访问令牌的正确数据结构,这证明服务器设置、授权类型、客户端凭据和用户凭据都是有效的。但在客户端,使用完全相同的代码,我有一个错误:

POST http://.../token 400 (Bad Request)
Error: failed [400] {"error":"invalid_request","error_description":"The grant type was not specified in the request"}

我做错了什么?为什么会这样?根本不可能在客户端上执行此类请求吗?

在运行HTTP.post()之前执行console.log(api)时会发生什么?一切都是干净的。同样,代码在客户端和服务器之间共享,并在服务器上完美运行。浏览器是否添加了导致其在浏览器中失败的内容(标题或其他内容)?