0
사전 시작 자습서에 따라 302 서버에서 오류을 발견했습니다. 열쇠는 신이며 모든 허락을 받았습니다.Prestashop webservice 302 localhost에서 오류가 발생했습니다
아이디어가 있으십니까?
// Here we define constants /!\ You need to replace this parameters
define('DEBUG', true); // Debug mode
define('PS_SHOP_PATH', 'http://127.0.0.1/mystore/prestashop/'); // Root path of your PrestaShop store
define('PS_WS_AUTH_KEY', 'XXXXXXXXXXXXXXXXXXXXXXXXXXXX'); // Auth key (Get it in your Back Office)
require_once('./PSWebServiceLibrary.php');
// Here we make the WebService Call
try
{
$webService = new PrestaShopWebservice(PS_SHOP_PATH, PS_WS_AUTH_KEY, DEBUG);
// Here we set the option array for the Webservice : we want customers resources
$opt['resource'] = 'customers';
// Call
$xml = $webService->get($opt);
// Here we get the elements from children of customers markup "customer"
$resources = $xml->customers->children();
}
catch (PrestaShopWebserviceException $e)
{
// Here we are dealing with errors
$trace = $e->getTrace();
if ($trace[0]['args'][0] == 404) echo 'Bad ID';
else if ($trace[0]['args'][0] == 401) echo 'Bad auth key';
else echo 'Other error';
}