本文整理汇总了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;
}