src/HttpRequest.php
public function request($method, $url, $params = array(), $vars = array()) {
    $this->request = curl_init();

    $this->setRequestMethod($method);
    $this->setOptions($url, $method, $params, $vars);

    $data = curl_exec($this->request);

    if ($data === false) {
      throw new \Exception('Curl Error: ' . curl_error($this->request));
    }

    $response = new HttpResponse($data);

    curl_close($this->request);

    return $response;
  }
public function request($method, $url, $params = array(), $vars = array()) {
    $this->request = curl_init();

    $this->setRequestMethod($method);
    $this->setOptions($url, $method, $params, $vars);

    $data = curl_exec($this->request);

    if ($data === false) {
      throw new \Exception('Curl Error: ' . curl_error($this->request));
    }

    $response = new HttpResponse($data);

    curl_close($this->request);

    return $response;
  }
public function request ( $ method , $ url , $ params = array ( ) , $ vars = array ( ) ) { $ this -> request = curl_init ( ) ; $ this -> setRequestMethod ( $ method ) ; $ this -> setOptions ( $ url , $ method , $ params , $ vars ) ; $ data = curl_exec ( $ this -> request ) ; if ( $ data === false ) { throw new \ Exception ( 'Curl Error: ' . curl_error ( $ this -> request ) ) ; } $ response = new HttpResponse ( $ data ) ; curl_close ( $ this -> request ) ; return $ response ; }
Executes a request

@param string $method
@param string $url
@param array $params
@param array $vars
@return HttpResponse
Executes a request