From: Vincent Vanwaelscappel Date: Tue, 8 Apr 2025 08:42:32 +0000 (+0200) Subject: #7454 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=2545bf61c6ae339b1a13903c563e8fb196b1350e;p=fluidbook_toolboxapiclient.git #7454 --- diff --git a/src/Client.php b/src/Client.php index ffec374..0ea9285 100644 --- a/src/Client.php +++ b/src/Client.php @@ -51,9 +51,9 @@ class Client return $response->getBody()->getContents(); } - public function createFluidbook(\SplFileInfo $file, $base, $title, $installServer, $installPath, $attributes = []): string + public function createFluidbook(\SplFileInfo $file, $base, $title, $installServer, $installPath, $attributes = []): \stdClass { - $data = array_merge($attributes, ['base' => $base, 'title' => $title, 'export[server]' => $installServer, 'export[path]' => $installPath]); + $data = array_merge(['base' => $base, 'title' => $title, 'export[server]' => $installServer, 'export[path]' => $installPath, 'attributes' => json_encode($attributes)]); $multipart = []; foreach ($data as $k => $v) { $multipart[] = ['name' => $k, 'contents' => $v]; @@ -75,7 +75,7 @@ class Client protected function _request($method, $uri, $options = []) { - return self::getResponseContents($this->getClient()->request($method, $uri, $options)); + return json_decode(self::getResponseContents($this->getClient()->request($method, $uri, $options))); }