@@ -231,7 +231,7 @@ public function resetRootPassword(): Action
231231 public function enableRescue ($ type = 'linux64 ' , $ ssh_keys = []): Action
232232 {
233233 $ response = $ this ->httpClient ->post ($ this ->replaceServerIdInUri ('servers/{id}/actions/enable_rescue ' ), [
234- 'form_params ' => [
234+ 'json ' => [
235235 'type ' => $ type ,
236236 'ssh_keys ' => $ ssh_keys ,
237237 ],
@@ -269,7 +269,7 @@ public function createImage(string $description = '', string $type = 'snapshot')
269269 {
270270
271271 $ response = $ this ->httpClient ->post ($ this ->replaceServerIdInUri ('servers/{id}/actions/create_image ' ), [
272- 'form_params ' => [
272+ 'json ' => [
273273 'description ' => $ description ,
274274 'type ' => $ type ,
275275 ],
@@ -290,7 +290,7 @@ public function createImage(string $description = '', string $type = 'snapshot')
290290 public function rebuildFromImage (Image $ image ): Action
291291 {
292292 $ response = $ this ->httpClient ->post ($ this ->replaceServerIdInUri ('servers/{id}/actions/rebuild ' ), [
293- 'form_params ' => [
293+ 'json ' => [
294294 'image ' => $ image ->id ,
295295 ],
296296 ]);
@@ -311,7 +311,7 @@ public function rebuildFromImage(Image $image): Action
311311 public function changeType (ServerType $ serverType , bool $ upgradeDisk = false ): Action
312312 {
313313 $ response = $ this ->httpClient ->post ($ this ->replaceServerIdInUri ('servers/{id}/actions/change_type ' ), [
314- 'form_params ' => [
314+ 'json ' => [
315315 'server_type ' => $ serverType ->id ,
316316 'upgrade_disk ' => $ upgradeDisk ,
317317 ],
@@ -332,7 +332,7 @@ public function changeType(ServerType $serverType, bool $upgradeDisk = false): A
332332 public function enableBackups (string $ backupWindow = null ): Action
333333 {
334334 $ response = $ this ->httpClient ->post ($ this ->replaceServerIdInUri ('servers/{id}/actions/enable_backup ' ), [
335- 'form_params ' => [
335+ 'json ' => [
336336 'backup_window ' => $ backupWindow ,
337337 ],
338338 ]);
@@ -367,7 +367,7 @@ public function disableBackups(): Action
367367 public function attachISO (ISO $ iso ): Action
368368 {
369369 $ response = $ this ->httpClient ->post ($ this ->replaceServerIdInUri ('servers/{id}/actions/attach_iso ' ), [
370- 'form_params ' => [
370+ 'json ' => [
371371 'iso ' => $ iso ->id ,
372372 ],
373373 ]);
@@ -403,7 +403,7 @@ public function detachISO(): Action
403403 public function changeReverseDNS (string $ ip , string $ dnsPtr ): Action
404404 {
405405 $ response = $ this ->httpClient ->post ($ this ->replaceServerIdInUri ('servers/{id}/actions/change_dns_ptr ' ), [
406- 'form_params ' => [
406+ 'json ' => [
407407 'ip ' => $ ip ,
408408 'dns_ptr ' => $ dnsPtr ,
409409 ],
@@ -454,7 +454,7 @@ public function delete(): Action
454454 public function changeName (string $ name ): Server
455455 {
456456 $ response = $ this ->httpClient ->put ($ this ->replaceServerIdInUri ('servers/{id} ' ), [
457- 'form_params ' => [
457+ 'json ' => [
458458 'name ' => $ name ,
459459 ],
460460 ]);
@@ -483,4 +483,4 @@ public static function parse($input)
483483 }
484484 return (new self ($ input ->id ))->setAdditionalData ($ input );
485485 }
486- }
486+ }
0 commit comments