private function apiServerSendData(array $data)
    {
        if ($this->transferException) {
            $curl = new Curl();
            $curl->setOpt(CURLOPT_CONNECTTIMEOUT, 2);
            $curl->setOpt(CURLOPT_TIMEOUT, 2);
            $curl->post(Url::ensureHttp(rtrim($this->api, '/')).'/create', [
                'error_json' => Json::encode($data),
            ]);
            
            $this->lastTransferCall = $curl;
            
            return $curl->isSuccess();
        }
        
        return null;
    }
private function apiServerSendData(array $data)
    {
        if ($this->transferException) {
            $curl = new Curl();
            $curl->setOpt(CURLOPT_CONNECTTIMEOUT, 2);
            $curl->setOpt(CURLOPT_TIMEOUT, 2);
            $curl->post(Url::ensureHttp(rtrim($this->api, '/')).'/create', [
                'error_json' => Json::encode($data),
            ]);
            
            $this->lastTransferCall = $curl;
            
            return $curl->isSuccess();
        }
        
        return null;
    }
private function apiServerSendData ( array $ data ) { if ( $ this -> transferException ) { $ curl = new Curl ( ) ; $ curl -> setOpt ( CURLOPT_CONNECTTIMEOUT , 2 ) ; $ curl -> setOpt ( CURLOPT_TIMEOUT , 2 ) ; $ curl -> post ( Url :: ensureHttp ( rtrim ( $ this -> api , '/' ) ) . '/create' , [ 'error_json' => Json :: encode ( $ data ) , ] ) ; $ this -> lastTransferCall = $ curl ; return $ curl -> isSuccess ( ) ; } return null ; }
Send the array data to the api server.

@param array $data The array to be sent to the server.
@return boolean|null true/false if data has been sent to the api successfull or not, null if the transfer is disabled.
Send the array data to the api server .