src/ApiClient/Client.php
public function postJson(string $path, array $body): ResponseInterface
    {
        $body = json_encode($body);

        if ($body === false) {
            throw new BokbasenApiClientException('Unable to convert data to json');
        }

        return $this->post(
            $path,
            $body,
            [
                'Content-Type' => HttpRequestOptions::CONTENT_TYPE_JSON,
            ]
        );
    }
public function postJson(string $path, array $body): ResponseInterface
    {
        $body = json_encode($body);

        if ($body === false) {
            throw new BokbasenApiClientException('Unable to convert data to json');
        }

        return $this->post(
            $path,
            $body,
            [
                'Content-Type' => HttpRequestOptions::CONTENT_TYPE_JSON,
            ]
        );
    }
public function postJson ( string $ path , array $ body ) : ResponseInterface { $ body = json_encode ( $ body ) ; if ( $ body === false ) { throw new BokbasenApiClientException ( 'Unable to convert data to json' ) ; } return $ this -> post ( $ path , $ body , [ 'Content-Type' => HttpRequestOptions :: CONTENT_TYPE_JSON , ] ) ; }
Special endpoint for posting json, sets correct content type header and encodes data as json

@param string $path
@param array  $body

@return ResponseInterface

@throws BokbasenApiClientException
Special endpoint for posting json sets correct content type header and encodes data as json