2014-12-05 108 views
1
createHook: function(scope,callback_url) { 
    http.open("POST","https://api.bigcommerce.com/"+this.context+"/v2/hooks",false); 
    http.setRequestHeader("Content-Type","application/json"); 
    http.setRequestHeader("Accept","application/json"); 
    http.setRequestHeader("X-Auth-Client",this.client_id); 
    http.setRequestHeader("X-Auth-Token",this.access_token); 
    http.send(JSON.stringify({ 
     scope: scope, 
     destination: callback_url, 
     is_active: true 
    })); 
} 

此尝试返回状态码400,其中的错误设置为“无效标头”。创建挂钩失败:无效标头

任何其他API函数(包括列表挂钩(GET/hooks))都是成功的。

+1

您已将此标签标记为classic asp。它这js应该运行客户端或服务器端? – John 2014-12-05 17:09:27

回答

0

我也遇到同样的错误,添加"X-Custom-Auth-Header": "{secret_auth_password}"后,它创建成功。 returs 201代码。