public function addSecondaryDnsDomains($domain, $domain2add, $ip) { $domain = (string) $domain; if (!$domain) { throw new BadMethodCallException('Parameter $domain is missing.'); } $domain2add = (string) $domain2add; if (!$domain2add) { throw new BadMethodCallException('Parameter $domain2add is missing.'); } $ip = (string) $ip; if (!$ip) { throw new BadMethodCallException('Parameter $ip is missing.'); } $payload = array("domain" => $domain2add, "ip" => $ip); try { $r = $this->post('dedicated/server/' . $domain . '/secondaryDnsDomains', array('Content-Type' => 'application/json;charset=UTF-8'), json_encode($payload))->send(); } catch (\Exception $e) { throw new ServerException($e->getMessage(), $e->getCode(), $e); } }