private function initiateUpload($url, $params)
    {
        $ch = curl_init($this->host.'/'.$url);

        if (!empty($params['file']))
        {
            $params['file'] .= ";filename=".basename($params['file']);
        }

        curl_setopt($ch, CURLOPT_HTTPHEADER, array(
            "Authentication: Token ". $this->token
        ));
        curl_setopt($ch, CURLOPT_POST, 1);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_POSTFIELDS, $params);

        return $ch;
    }
private function initiateUpload($url, $params)
    {
        $ch = curl_init($this->host.'/'.$url);

        if (!empty($params['file']))
        {
            $params['file'] .= ";filename=".basename($params['file']);
        }

        curl_setopt($ch, CURLOPT_HTTPHEADER, array(
            "Authentication: Token ". $this->token
        ));
        curl_setopt($ch, CURLOPT_POST, 1);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_POSTFIELDS, $params);

        return $ch;
    }
private function initiateUpload ( $ url , $ params ) { $ ch = curl_init ( $ this -> host . '/' . $ url ) ; if ( ! empty ( $ params [ 'file' ] ) ) { $ params [ 'file' ] .= ";filename=" . basename ( $ params [ 'file' ] ) ; } curl_setopt ( $ ch , CURLOPT_HTTPHEADER , array ( "Authentication: Token " . $ this -> token ) ) ; curl_setopt ( $ ch , CURLOPT_POST , 1 ) ; curl_setopt ( $ ch , CURLOPT_RETURNTRANSFER , 1 ) ; curl_setopt ( $ ch , CURLOPT_POSTFIELDS , $ params ) ; return $ ch ; }
Initiate curl session for POST upload

@param string $url   Relative url for the request
@param array $params Parameters for the request
@return resource
Initiate curl session for POST upload