本文整理汇总了PHP中HTTP_Request::HTTP_Request方法的典型用法代码示例。如果您正苦于以下问题:PHP HTTP_Request::HTTP_Request方法的具体用法?PHP HTTP_Request::HTTP_Request怎么用?PHP HTTP_Request::HTTP_Request使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTTP_Request
的用法示例。
在下文中一共展示了HTTP_Request::HTTP_Request方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: HTTP_Request_OAuth
/**
* 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');
}