7

我已经毫无问题地在 OAuth 的第 1 步中检索了授权代码,但对于我来说,我无法完成获取访问令牌的帖子。我总是遇到同样的错误:

content: "{"error":"invalid_request","error_description":"Could not find Shopify API appli... (length: 103)"

这是我的代码的样子……Meteor.http.post 是一个标准的发布请求。我已经尝试了各种组合,但没有任何运气。我正在本地主机上开发:

var url = 'https://' + shopName + '/admin/oauth/access_token';    
var data = { client_id: apiKey, client_secret: secret, code: code };

Meteor.http.post(url, data,
    function(error, result) {
        debugger;
    });

Meteor.post 是此处记录的标准服务器端发布请求。我尝试过参数(如 Node Wrapper)、数组(如 PHP)和其他东西的组合。我不知道。

是因为我在 localhost 上开发并且服务器调用现在需要 https 吗?我的帖子数据结构错了吗?

任何其他想法我做错了什么?

4

1 回答 1

3

我知道您说过您尝试了参数,但将参数作为数据放入这样的数据是行不通的。尝试这个..

var url = 'https://' + shopName + '/admin/oauth/access_token';    
var data = { client_id: apiKey, client_secret: secret, code: code };

Meteor.http.post(url, {params:data},
    function(error, result) {
        debugger;
});
于 2013-01-17T06:50:57.853 回答