public function newRequest($method, $url, $data = array(), $encoding = Request::ENCODING_QUERY)
	{
		$class = $this->requestClass;
		$request = new $class($this);

		if ($this->defaultHeaders) {
			$request->setHeaders($this->defaultHeaders);
		}
		if ($this->defaultOptions) {
			$request->setOptions($this->defaultOptions);
		}
		$request->setMethod($method);
		$request->setUrl($url);
		$request->setData($data);
		$request->setEncoding($encoding);

		return $request;
	}
public function newRequest($method, $url, $data = array(), $encoding = Request::ENCODING_QUERY)
	{
		$class = $this->requestClass;
		$request = new $class($this);

		if ($this->defaultHeaders) {
			$request->setHeaders($this->defaultHeaders);
		}
		if ($this->defaultOptions) {
			$request->setOptions($this->defaultOptions);
		}
		$request->setMethod($method);
		$request->setUrl($url);
		$request->setData($data);
		$request->setEncoding($encoding);

		return $request;
	}
public function newRequest ( $ method , $ url , $ data = array ( ) , $ encoding = Request :: ENCODING_QUERY ) { $ class = $ this -> requestClass ; $ request = new $ class ( $ this ) ; if ( $ this -> defaultHeaders ) { $ request -> setHeaders ( $ this -> defaultHeaders ) ; } if ( $ this -> defaultOptions ) { $ request -> setOptions ( $ this -> defaultOptions ) ; } $ request -> setMethod ( $ method ) ; $ request -> setUrl ( $ url ) ; $ request -> setData ( $ data ) ; $ request -> setEncoding ( $ encoding ) ; return $ request ; }
Create a new response object and set its values.

@param  string  $method    get, post, etc
@param  string  $url
@param  mixed   $data      POST data
@param  int     $encoding  Request::ENCODING_* constant specifying how to process the POST data

@return Request
Create a new response object and set its values .