Prestashop REST API使用PHP客户端返回错误的HTTP响应

问题描述 投票:0回答:1

此代码:

try {
    // creating webservice access
    $webService = new PrestaShopWebservice('https://149.28.159.206/', '6DE5PU9M9SC7RZCRFF4VK3MFDVVTGRJT', false);

    // call to retrieve all customers
    $xml = $webService->get(['resource' => 'products']);
} catch (PrestaShopWebserviceException $ex) {
    // Shows a message related to the error
    echo 'Other error: <br />' . $ex->getMessage();
}

正在返回以下错误:

Other error: <br />Bad HTTP response

而且我已经使用适当的权限激活了密钥(请参阅所附的屏幕截图)。但是,它给出了此错误。

enter image description here

我可以知道为什么,如何解决这个问题?

我正在从vultr.com云实例在Ubuntu 18.04 x64上使用Prestashop 1.7.6.5。

prestashop
1个回答
0
投票

Prestashop将Domain / api用于网络服务。

尝试“ https://149.28.159.206/api/”]

© www.soinside.com 2019 - 2024. All rights reserved.