Commit bd33c2b8 authored by Ludwig Ruderstaller's avatar Ludwig Ruderstaller
Browse files

Fixing zone Export as Bind file

parent 11a22398
Pipeline #25954 failed with stage
in 1 minute and 48 seconds
......@@ -72,7 +72,7 @@ class Client
*
* @return mixed
*/
public function call($payload = null, $uri, $hydrationClass = null, $isList = false, $method = 'GET', array $queryParams = [])
public function call($payload = null, $uri, $hydrationClass = null, $isList = false, $method = 'GET', array $queryParams = [], $isJson = true)
{
$uri = rtrim(sprintf('%s/%s', $this->apiUri, $uri), '/');
......@@ -86,10 +86,15 @@ class Client
], $payload);
$response = $this->client->sendRequest($request);
$responseBody = $response->getBody()->getContents();
if (!$isJson) {
return $responseBody;
}
$responseData = json_decode($responseBody);
if ($response->getStatusCode() >= 300 && isset($responseData->error)) {
throw new \LogicException(sprintf('Error on %s request %s: %s', $method, $uri, $responseData->error));
}
......
......@@ -187,7 +187,7 @@ class ZonesEndpoint extends AbstractEndpoint
$zoneId = $zoneId->getId();
}
return $this->getClient()->call(null, sprintf(self::ENDPOINT_ELEMENT, $this->defaultServerId, $zoneId).'/export', null, false, 'GET');
return $this->getClient()->call(null, sprintf(self::ENDPOINT_ELEMENT, $this->defaultServerId, $zoneId).'/export', null, false, 'GET', [], false);
}
/**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment