protected function sendRequest($method, $url, $body)
    {
        $options = [
            'headers' => [
                'Accept-Encoding' => 'gzip',
                'Content-Type' => 'application/json',
            ],
            'body' => $body,
        ];

        try {
            $response = $this->client->request($method, $url, $options);
            return json_decode($response->getBody(), true);
        } catch (ClientException $e) {
            throw new PredictionIOAPIError($e->getMessage());
        }
    }
protected function sendRequest($method, $url, $body)
    {
        $options = [
            'headers' => [
                'Accept-Encoding' => 'gzip',
                'Content-Type' => 'application/json',
            ],
            'body' => $body,
        ];

        try {
            $response = $this->client->request($method, $url, $options);
            return json_decode($response->getBody(), true);
        } catch (ClientException $e) {
            throw new PredictionIOAPIError($e->getMessage());
        }
    }
protected function sendRequest ( $ method , $ url , $ body ) { $ options = [ 'headers' => [ 'Accept-Encoding' => 'gzip' , 'Content-Type' => 'application/json' , ] , 'body' => $ body , ] ; try { $ response = $ this -> client -> request ( $ method , $ url , $ options ) ; return json_decode ( $ response -> getBody ( ) , true ) ; } catch ( ClientException $ e ) { throw new PredictionIOAPIError ( $ e -> getMessage ( ) ) ; } }
Send a HTTP request to the server

@param string $method HTTP request method
@param string $url Relative or absolute url
@param string $body HTTP request body

@return array JSON response
@throws PredictionIOAPIError Request error
Send a HTTP request to the server