/** * Constructor * * Sets up the object * @param string The url to fetch/access * @param array Associative array of parameters which can have the following keys: * <ul> * <li>consumer_key - Oauth consumer key (string)</li> * <li>consumer_secret - Oauth consumer secret (string)</li> * <li>signature_method - TBD</li> * <li>token - Oauth session token or frob (string)</li> * <li>token_secret - Oauth session secret (string)</li> * <li>realm - Oauth realm (string)</li> * <li>method - Method to use, GET, POST etc (string)</li> * <li>http - HTTP Version to use, 1.0 or 1.1 (string)</li> * <li>user - Basic Auth username (string)</li> * <li>pass - Basic Auth password (string)</li> * <li>proxy_host - Proxy server host (string)</li> * <li>proxy_port - Proxy server port (integer)</li> * <li>proxy_user - Proxy auth username (string)</li> * <li>proxy_pass - Proxy auth password (string)</li> * <li>timeout - Connection timeout in seconds (float)</li> * <li>allowRedirects - Whether to follow redirects or not (bool)</li> * <li>maxRedirects - Max number of redirects to follow (integer)</li> * <li>useBrackets - Whether to append [] to array variable names (bool)</li> * <li>saveBody - Whether to save response body in response object property (bool)</li> * <li>readTimeout - Timeout for reading / writing data over the socket (array (seconds, microseconds))</li> * <li>socketOptions - Options to pass to Net_Socket object (array)</li> * </ul> * @access public */ function HTTP_Request_OAuth($url = '', $params = array()) { $this->_realm = null; $this->_token = null; $this->_token_secret = null; $this->_consumer_key = null; $this->_consumer_secret = null; $this->signature_method = $params['signature_method']; HTTP_Request::HTTP_Request($url, $params); $this->addHeader('User-Agent', 'PHP HTTP_Request_OAuth class'); }