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];
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)));
}