Merge pull request #180 from tuxis-ie/fix-api-calls

Fix api calls
This commit is contained in:
Tuxis Internet Engineering V.O.F 2018-08-22 15:54:32 +02:00 committed by GitHub
commit 3facd3271f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 8 deletions

View file

@ -32,13 +32,7 @@ class ApiHandler {
$tmp->url = '/api/v1/servers/localhost';
$tmp->go();
$v = intval(substr($tmp->json["version"],0,1));
if ($v == 4) {
$this->apiurl = $tmp->json["url"];
} else {
throw new Exception("Unsupported API version");
}
}
private function curlopts() {

View file

@ -64,7 +64,7 @@ class PdnsAPI {
if (!isset($zone['serial']) or gettype($zone['serial']) != 'integer') {
$api->method = 'POST';
$api->url = '/localhost/zones';
$api->url = '/zones';
$api->content = json_encode($zonedata);
$api->call();