Ibm mobilefirst 移动第一&;Magento使用者无权访问%resources REST API

Ibm mobilefirst 移动第一&;Magento使用者无权访问%resources REST API,ibm-mobilefirst,magento2,mobilefirst-adapters,Ibm Mobilefirst,Magento2,Mobilefirst Adapters,我在适配器的MobileFIrst项目(Worcklight)中使用MAGENTO 2 REST API: function _retrieve(token) { if (!token) return { 'isSuccessful': false, 'errorMsg' : 'params is ' + params}; var authtok = "Bearer "+ token; var input = { method : 'ge

我在适配器的MobileFIrst项目(Worcklight)中使用MAGENTO 2 REST API:

function _retrieve(token) { 
    if (!token)
        return { 'isSuccessful': false, 'errorMsg' : 'params is ' + params};
    var authtok = "Bearer "+ token;
    var input = {
        method : 'get',
        returnedContentType : 'json',
        path : 'rest/default/V1/categories/41/products',
        parameters: { },
        headers: {"Accept":"application\/json", "Authorization":authtok} 
    };
    return WL.Server.invokeHttp(input);
}
得到这个结果:

{"message":"Consumer is not authorized to access %resources","statusCode":401,"isSuccessful":true,"statusReason":"Unauthorized","parameters":{"resources":"self"},"responseHeaders":{"Content-Length":"95","Expires":"Thu, 19 Nov 1981 08:52:00 GMT","X-XSS-Protection":"1; mode=block","Connection":"Keep-Alive","Server":"Apache\/2.4.17 (Win32) OpenSSL\/1.0.2d PHP\/5.6.15","X-Powered-By":"PHP\/5.6.15","Cache-Control":"no-store, no-cache, must-revalidate, post-check=0, pre-check=0","Pragma":"no-cache","X-Content-Type-Options":"nosniff","Date":"Mon, 21 Mar 2016 13:04:35 GMT","Access-Control-Allow-Origin":"*","Keep-Alive":"timeout=5, max=100","Content-Type":"application\/json; charset=utf-8"},"responseTime":1899,"totalTime":1899}*/
当我使用RestClient时,它会工作

Status:200: OK

您能否启用wireshark跟踪并比较两种调用方式(一种来自RestClient,另一种来自HTTP适配器)之间的网络流量,并查看请求格式是否存在任何问题