From 1baeeee88266e3c2852d674ffbce6d059d012979 Mon Sep 17 00:00:00 2001 From: Junade Ali Date: Wed, 20 Sep 2017 13:15:34 +0100 Subject: [PATCH] COM-40 :: Change API submission type to JSON and adjust function names --- src/Adapter/Guzzle.php | 6 +++--- src/Endpoints/Zones.php | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Adapter/Guzzle.php b/src/Adapter/Guzzle.php index fad8129..e9739e6 100644 --- a/src/Adapter/Guzzle.php +++ b/src/Adapter/Guzzle.php @@ -71,7 +71,7 @@ class Guzzle implements Adapter $response = $this->client->put($uri, [ 'headers' => $headers, - 'body' => $jsonBody + 'json' => $jsonBody ] ); @@ -88,7 +88,7 @@ class Guzzle implements Adapter $response = $this->client->patch($uri, [ 'headers' => $headers, - 'body' => $jsonBody + 'json' => $jsonBody ] ); @@ -103,7 +103,7 @@ class Guzzle implements Adapter { $response = $this->client->delete($uri, [ 'headers' => $headers, - 'form_params' => $body + 'json' => $body ] ); diff --git a/src/Endpoints/Zones.php b/src/Endpoints/Zones.php index 13dc83b..b81343d 100644 --- a/src/Endpoints/Zones.php +++ b/src/Endpoints/Zones.php @@ -108,7 +108,7 @@ class Zones implements API * @param string $zoneID * @return bool */ - public function purgeAll(string $zoneID): bool + public function cachePurgeEverything(string $zoneID): bool { $user = $this->adapter->delete('zones/' . $zoneID . '/purge_cache', [], ["purge_everything" => true]); @@ -121,7 +121,7 @@ class Zones implements API return false; } - public function purge(string $zoneID, array $files = [], array $tags = []): bool + public function cachePurge(string $zoneID, array $files = [], array $tags = []): bool { if (empty($files) && empty($tags)) { throw new EndpointException("No files or tags to purge.");