original_string: private function sendRequest($url, $params, $post = 1, $headers = array('Accept: application/json, text/javascript, */*; q=0.01', 'Content-Type=application/x-www-form-urlencoded'))
  	{
  		$ch = curl_init();
  		curl_setopt($ch, CURLOPT_URL, $url);
  		curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  		if (null !== $params)
  			curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params, null, '&'));
  		curl_setopt($ch, CURLOPT_POST, $post);
  		curl_setopt($ch, CURLOPT_HEADER, 1);
  		if (isset($this->token))
  		{
  			$headers[] = 'Authorization: '.$this->token;
  		}
  		curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
  		curl_setopt($ch, CURLOPT_VERBOSE, 0);
  		curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  		curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
  		curl_setopt($ch, CURLOPT_COOKIEJAR, $this->cacheFolder."/cookies.txt");
  		curl_setopt($ch, CURLOPT_COOKIEFILE, $this->cacheFolder."/cookies.txt");
  		// Fake user agent to simulate a real browser
  		curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/41.0.2272.76 Chrome/41.0.2272.76 Safari/537.36");
  		curl_setopt($ch, CURLOPT_REFERER, $this->baseUrl);
  		$response = curl_exec($ch);
  
  		$header_size = curl_getinfo($ch, CURLINFO_HEADER_SIZE);
  		$header      = substr($response, 0, $header_size);
  		$body        = substr($response, $header_size);
  		$last_url    = curl_getinfo($ch, CURLINFO_EFFECTIVE_URL);
  		$info        = curl_getinfo($ch);
  
  		curl_close($ch);
  
  		return array('body' => $body, 'header' => $header, 'url' => $last_url);
  	}
code: private function sendRequest($url, $params, $post = 1, $headers = array('Accept: application/json, text/javascript, */*; q=0.01', 'Content-Type=application/x-www-form-urlencoded'))
  	{
  		$ch = curl_init();
  		curl_setopt($ch, CURLOPT_URL, $url);
  		curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  		if (null !== $params)
  			curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params, null, '&'));
  		curl_setopt($ch, CURLOPT_POST, $post);
  		curl_setopt($ch, CURLOPT_HEADER, 1);
  		if (isset($this->token))
  		{
  			$headers[] = 'Authorization: '.$this->token;
  		}
  		curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
  		curl_setopt($ch, CURLOPT_VERBOSE, 0);
  		curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  		curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
  		curl_setopt($ch, CURLOPT_COOKIEJAR, $this->cacheFolder."/cookies.txt");
  		curl_setopt($ch, CURLOPT_COOKIEFILE, $this->cacheFolder."/cookies.txt");
  		// Fake user agent to simulate a real browser
  		curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/41.0.2272.76 Chrome/41.0.2272.76 Safari/537.36");
  		curl_setopt($ch, CURLOPT_REFERER, $this->baseUrl);
  		$response = curl_exec($ch);
  
  		$header_size = curl_getinfo($ch, CURLINFO_HEADER_SIZE);
  		$header      = substr($response, 0, $header_size);
  		$body        = substr($response, $header_size);
  		$last_url    = curl_getinfo($ch, CURLINFO_EFFECTIVE_URL);
  		$info        = curl_getinfo($ch);
  
  		curl_close($ch);
  
  		return array('body' => $body, 'header' => $header, 'url' => $last_url);
  	}
code_tokens: private function sendRequest ( $ url , $ params , $ post = 1 , $ headers = array ( 'Accept: application/json, text/javascript, */*; q=0.01' , 'Content-Type=application/x-www-form-urlencoded' ) ) { $ ch = curl_init ( ) ; curl_setopt ( $ ch , CURLOPT_URL , $ url ) ; curl_setopt ( $ ch , CURLOPT_RETURNTRANSFER , 1 ) ; if ( null !== $ params ) curl_setopt ( $ ch , CURLOPT_POSTFIELDS , http_build_query ( $ params , null , '&' ) ) ; curl_setopt ( $ ch , CURLOPT_POST , $ post ) ; curl_setopt ( $ ch , CURLOPT_HEADER , 1 ) ; if ( isset ( $ this -> token ) ) { $ headers [ ] = 'Authorization: ' . $ this -> token ; } curl_setopt ( $ ch , CURLOPT_HTTPHEADER , $ headers ) ; curl_setopt ( $ ch , CURLOPT_VERBOSE , 0 ) ; curl_setopt ( $ ch , CURLOPT_FOLLOWLOCATION , 1 ) ; curl_setopt ( $ ch , CURLOPT_CONNECTTIMEOUT , 10 ) ; curl_setopt ( $ ch , CURLOPT_COOKIEJAR , $ this -> cacheFolder . "/cookies.txt" ) ; curl_setopt ( $ ch , CURLOPT_COOKIEFILE , $ this -> cacheFolder . "/cookies.txt" ) ; // Fake user agent to simulate a real browser curl_setopt ( $ ch , CURLOPT_USERAGENT , "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/41.0.2272.76 Chrome/41.0.2272.76 Safari/537.36" ) ; curl_setopt ( $ ch , CURLOPT_REFERER , $ this -> baseUrl ) ; $ response = curl_exec ( $ ch ) ; $ header_size = curl_getinfo ( $ ch , CURLINFO_HEADER_SIZE ) ; $ header = substr ( $ response , 0 , $ header_size ) ; $ body = substr ( $ response , $ header_size ) ; $ last_url = curl_getinfo ( $ ch , CURLINFO_EFFECTIVE_URL ) ; $ info = curl_getinfo ( $ ch ) ; curl_close ( $ ch ) ; return array ( 'body' => $ body , 'header' => $ header , 'url' => $ last_url ) ; }
docstring: Send a request using cURL
  
  @param string $url URL of the request
  @param string $params Post parameters to send
  @param string $post Boolean whether it is a post request or not
  @return array
docstring_tokens: Send a request using cURL