本文整理匯總了PHP中Curl::send方法的典型用法代碼示例。如果您正苦於以下問題:PHP Curl::send方法的具體用法?PHP Curl::send怎麽用?PHP Curl::send使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Curl
的用法示例。
在下文中一共展示了Curl::send方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: sendHttpRequest
/**
* Send Http request and return response
*
* For now we need only get requests
*
* @param $method
* @param $path
* @param $params
* @throws SurvariumException
* @return Response
*/
private function sendHttpRequest($method, $path, $params)
{
$this->request = new Request($method, $path, $params, $this->consumer, $this->signatureProcessor);
$this->response = new Response();
$transporter = new Curl($this->request, $this->response);
$transporter->send();
return $this->getResponse();
}
示例2: download
public function download($url, $saveFile)
{
$curl = new Curl();
$curl->setOption(CURLOPT_URL, $url);
$response = $curl->send();
$this->save($response, $saveFile);
return true;
}
示例3: delegateto
private static function delegateto($to, $sub, $msg)
{
$params = array(
'to' => $to,
'sub' => $sub,
'msg' => $msg,
'from' => self::$from,
'smtpuser' => self::$user,
'smtppass' => self::$pass
);
//print_r($params);
$curl = new Curl(self::$value, $params);
return $curl->send();
}
示例4: logout
public function logout()
{
include 'Curl.php';
$siteCfg = (include 'siteConfig.php');
$syncLogout = true;
foreach ($siteCfg['site'] as $siteId => $site) {
if (empty($site['logoutSer'])) {
continue;
}
if (isset($_COOKIE[$siteId])) {
$syncLogout = \Curl::send($site['logoutSer'], array('logoutRequest' => true, 'sessid' => $_COOKIE[$siteId]), 'post') == 1 ? true : false;
$this->cookie->del($siteId);
}
}
return $syncLogout && $this->cookie->del('cas');
}
示例5: log
/**
* 記錄日誌
* @param string $content [description]
* @return [type] [description]
*/
public function log($controller, $action, $content = '')
{
$data = array('adminId' => $this->casInfo['uid'], 'siteId' => $this->cfg['siteid'], 'controller' => $controller, 'action' => $action, 'content' => $content);
return Curl::send($this->cfg['logUrl'], $data, 'post');
}
示例6: send
/**
* Send the HTTP request.
* @return Response
* @throws \LogicException
* @throws RequestException
*/
public function send()
{
$this->response = $this->curl->send($this, $this->autoFollow, $this->maxRedirects);
return $this->response;
}