/** * Constructor * * @throws Horde_Http_Exception */ public function __construct($args = array()) { if (!extension_loaded('curl')) { throw new Horde_Http_Exception('The curl extension is not installed. See http://php.net/curl.installation'); } parent::__construct($args); }
/** * Constructor * * @throws Horde_Http_Exception */ public function __construct($args = array()) { if (!ini_get('allow_url_fopen')) { throw new Horde_Http_Exception('allow_url_fopen must be enabled'); } parent::__construct($args); }
/** * Sends an HTTP request. * * @param string $method HTTP request method (GET, PUT, etc.) * @param string|Horde_Url $uri URI to request, if different from * $this->uri * @param string|array $data Request data. Array of form data that will * be encoded automatically, or a raw string. * @param array $headers Any headers specific to this request. They * will be combined with $this->_headers, and * override headers of the same name for this * request only. * * @throws Horde_Http_Exception * @return Horde_Http_Response_Base */ public function request($method, $uri = null, $data = null, $headers = array()) { if ($method !== null) { $this->request->method = $method; } if ($uri !== null) { $this->request->uri = $uri; } if ($data !== null) { $this->request->data = $data; } if (count($headers)) { $this->request->setHeaders($headers); } $this->_lastRequest = $this->_request; $this->_lastResponse = $this->_request->send(); return $this->_lastResponse; }
/** * Constructor. * * @throws Horde_Http_Exception */ public function __construct($args = array()) { parent::__construct($args); }