public function Create($url, $method = 'GET', $parameters = array())
	{
		$ch = curl_init();
		$key= (string)$ch;
		$query = '';
		$res = null;
		
		$options = $this->_options;
		
		foreach ($parameters as $k => $v)
			$query .= ((strlen ($query) == 0) ? "":"&") . sprintf('%s=%s', $k, urlencode($v));

		switch (strtolower($method))
		{
			case 'post':
				$options[CURLOPT_POST] = true;
				$options[CURLOPT_POSTFIELDS] = $query;
				break;
			case 'delete':
				$options[CURLOPT_CUSTOMREQUEST] = 'DELETE';
				$url .= '?' . $query;
				break;
			default:
				$url .= '?' . $query;
				break;
		}
		
		$options[CURLOPT_URL] = $url;
		curl_setopt_array($ch, $options);
		
		$this->_requests[$key] = $ch;
		
		$res = curl_multi_add_handle($this->mh, $this->_requests[$key]);
		if ($res == CURLM_OK) {
			curl_multi_exec($this->mh, $active);
			return new WebRequestManager($key, $this->config);
		}
		return new Error('cURLError', curl_error($ch), curl_errno($ch), $options[CURLOPT_URL]);
	}
public function Create($url, $method = 'GET', $parameters = array())
	{
		$ch = curl_init();
		$key= (string)$ch;
		$query = '';
		$res = null;
		
		$options = $this->_options;
		
		foreach ($parameters as $k => $v)
			$query .= ((strlen ($query) == 0) ? "":"&") . sprintf('%s=%s', $k, urlencode($v));

		switch (strtolower($method))
		{
			case 'post':
				$options[CURLOPT_POST] = true;
				$options[CURLOPT_POSTFIELDS] = $query;
				break;
			case 'delete':
				$options[CURLOPT_CUSTOMREQUEST] = 'DELETE';
				$url .= '?' . $query;
				break;
			default:
				$url .= '?' . $query;
				break;
		}
		
		$options[CURLOPT_URL] = $url;
		curl_setopt_array($ch, $options);
		
		$this->_requests[$key] = $ch;
		
		$res = curl_multi_add_handle($this->mh, $this->_requests[$key]);
		if ($res == CURLM_OK) {
			curl_multi_exec($this->mh, $active);
			return new WebRequestManager($key, $this->config);
		}
		return new Error('cURLError', curl_error($ch), curl_errno($ch), $options[CURLOPT_URL]);
	}
public function Create ( $ url , $ method = 'GET' , $ parameters = array ( ) ) { $ ch = curl_init ( ) ; $ key = ( string ) $ ch ; $ query = '' ; $ res = null ; $ options = $ this -> _options ; foreach ( $ parameters as $ k => $ v ) $ query .= ( ( strlen ( $ query ) == 0 ) ? "" : "&" ) . sprintf ( '%s=%s' , $ k , urlencode ( $ v ) ) ; switch ( strtolower ( $ method ) ) { case 'post' : $ options [ CURLOPT_POST ] = true ; $ options [ CURLOPT_POSTFIELDS ] = $ query ; break ; case 'delete' : $ options [ CURLOPT_CUSTOMREQUEST ] = 'DELETE' ; $ url .= '?' . $ query ; break ; default : $ url .= '?' . $ query ; break ; } $ options [ CURLOPT_URL ] = $ url ; curl_setopt_array ( $ ch , $ options ) ; $ this -> _requests [ $ key ] = $ ch ; $ res = curl_multi_add_handle ( $ this -> mh , $ this -> _requests [ $ key ] ) ; if ( $ res == CURLM_OK ) { curl_multi_exec ( $ this -> mh , $ active ) ; return new WebRequestManager ( $ key , $ this -> config ) ; } return new Error ( 'cURLError' , curl_error ( $ ch ) , curl_errno ( $ ch ) , $ options [ CURLOPT_URL ] ) ; }
Creates a new cURL reuest and adds to the request queue for processing
@param string $url The url in which to make the request
@param string $method The method used to make the request [GET|POST|DELETE]
@param array $parameters Array of key/value pairs to pass to the request
@return mixed A WebRequestManager to manage the current request on success, Error on failure
@access public
Creates a new cURL reuest and adds to the request queue for processing