|
|
|
@ -26,6 +26,7 @@
|
|
|
|
|
*
|
|
|
|
|
* Put the credentials in ~/.edgerc as demonstrated by api-kickstart/sample_edgerc
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
namespace Akamai\Open\Example;
|
|
|
|
|
|
|
|
|
|
require_once __DIR__ . '/cli/init.php';
|
|
|
|
@ -59,20 +60,20 @@ class CcuClient
|
|
|
|
|
|
|
|
|
|
$ccu = new CcuClient();
|
|
|
|
|
$url = $_POST['url'];
|
|
|
|
|
|
|
|
|
|
echo $url;die();
|
|
|
|
|
try {
|
|
|
|
|
$objects = [
|
|
|
|
|
$url
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
$purge = $ccu->postPurgeRequest('data.chinarundreisen.com', $objects);
|
|
|
|
|
$purge = $ccu->postPurgeRequest('data.chinahighlights.com', $objects);
|
|
|
|
|
$response = json_decode($purge->getBody());
|
|
|
|
|
if($response->httpStatus == 201){
|
|
|
|
|
if ($response->httpStatus == 201) {
|
|
|
|
|
echo '{"msg":"success"}';
|
|
|
|
|
}else{
|
|
|
|
|
} else {
|
|
|
|
|
echo json_encode($response);
|
|
|
|
|
}
|
|
|
|
|
} catch (\GuzzleHttp\Exception\ClientException $e) {
|
|
|
|
|
header("status: 404 not found");
|
|
|
|
|
echo "An error occurred: " .$e->getMessage(). "\n";
|
|
|
|
|
echo "An error occurred: " . $e->getMessage() . "\n";
|
|
|
|
|
}
|
|
|
|
|