From ee0cabebf0c27bfb50bd361d9dfa04763c83071b Mon Sep 17 00:00:00 2001 From: jmjmjm <7957056+jmjmjm@users.noreply.github.com> Date: Sat, 3 Feb 2018 22:47:54 +0100 Subject: [PATCH] Changed Content Type from form to json in Server Model --- src/Models/Servers/Server.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Models/Servers/Server.php b/src/Models/Servers/Server.php index d26a939..582689b 100644 --- a/src/Models/Servers/Server.php +++ b/src/Models/Servers/Server.php @@ -231,7 +231,7 @@ public function resetRootPassword(): Action public function enableRescue($type = 'linux64', $ssh_keys = []): Action { $response = $this->httpClient->post($this->replaceServerIdInUri('servers/{id}/actions/enable_rescue'), [ - 'form_params' => [ + 'json' => [ 'type' => $type, 'ssh_keys' => $ssh_keys, ], @@ -269,7 +269,7 @@ public function createImage(string $description = '', string $type = 'snapshot') { $response = $this->httpClient->post($this->replaceServerIdInUri('servers/{id}/actions/create_image'), [ - 'form_params' => [ + 'json' => [ 'description' => $description, 'type' => $type, ], @@ -290,7 +290,7 @@ public function createImage(string $description = '', string $type = 'snapshot') public function rebuildFromImage(Image $image): Action { $response = $this->httpClient->post($this->replaceServerIdInUri('servers/{id}/actions/rebuild'), [ - 'form_params' => [ + 'json' => [ 'image' => $image->id, ], ]); @@ -311,7 +311,7 @@ public function rebuildFromImage(Image $image): Action public function changeType(ServerType $serverType, bool $upgradeDisk = false): Action { $response = $this->httpClient->post($this->replaceServerIdInUri('servers/{id}/actions/change_type'), [ - 'form_params' => [ + 'json' => [ 'server_type' => $serverType->id, 'upgrade_disk' => $upgradeDisk, ], @@ -332,7 +332,7 @@ public function changeType(ServerType $serverType, bool $upgradeDisk = false): A public function enableBackups(string $backupWindow = null): Action { $response = $this->httpClient->post($this->replaceServerIdInUri('servers/{id}/actions/enable_backup'), [ - 'form_params' => [ + 'json' => [ 'backup_window' => $backupWindow, ], ]); @@ -367,7 +367,7 @@ public function disableBackups(): Action public function attachISO(ISO $iso): Action { $response = $this->httpClient->post($this->replaceServerIdInUri('servers/{id}/actions/attach_iso'), [ - 'form_params' => [ + 'json' => [ 'iso' => $iso->id, ], ]); @@ -403,7 +403,7 @@ public function detachISO(): Action public function changeReverseDNS(string $ip, string $dnsPtr): Action { $response = $this->httpClient->post($this->replaceServerIdInUri('servers/{id}/actions/change_dns_ptr'), [ - 'form_params' => [ + 'json' => [ 'ip' => $ip, 'dns_ptr' => $dnsPtr, ], @@ -454,7 +454,7 @@ public function delete(): Action public function changeName(string $name): Server { $response = $this->httpClient->put($this->replaceServerIdInUri('servers/{id}'), [ - 'form_params' => [ + 'json' => [ 'name' => $name, ], ]); @@ -483,4 +483,4 @@ public static function parse($input) } return (new self($input->id))->setAdditionalData($input); } -} \ No newline at end of file +}