本文整理汇总了PHP中Curl\Curl::_exec方法的典型用法代码示例。如果您正苦于以下问题:PHP Curl::_exec方法的具体用法?PHP Curl::_exec怎么用?PHP Curl::_exec使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Curl\Curl
的用法示例。
在下文中一共展示了Curl::_exec方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _exec
public function _exec()
{
parent::_exec();
if ($this->error) {
throw new CurlException($this->curl->error_message, $this->curl->error_code);
}
}
示例2: update
public function update($c_id, $fname = '', $mname = '', $lname = '', $gen = '', $avatar = '', $addl1 = '', $addl2 = '', $city = '', $state = '', $country = '', $zip = '', $dob = '')
{
$curl = new Curl();
$curl->setopt(CURLOPT_URL, "https://v2.api.xapo.com/customers/{$c_id}/?first_name={$fname}middle_name={$mname}&last_name={$lname}&gender={$gen}&avatar={$avatar}&address_line_1={$addl1}&address_line_2={$addl2}&city={$city}&state={$state}&country_iso3={$country}&zip_code={$zip}&date_of_birth={$dob}");
$curl->setopt(CURLOPT_RETURNTRANSFER, true);
$curl->setopt(CURLOPT_HEADER, false);
$curl->setopt(CURLOPT_CUSTOMREQUEST, 'PATCH');
$curl->_exec();
$response = $curl->response;
$curl->close();
return json_decode($response);
}
示例3: prim_address
public function prim_address($token, $acc_id)
{
$curl = new Curl();
$curl->setopt(CURLOPT_URL, "https://v2.api.xapo.com/accounts/{$acc_id}/primary_address/");
$curl->setopt(CURLOPT_RETURNTRANSFER, true);
$curl->setopt(CURLOPT_HEADER, false);
$curl->setopt(CURLOPT_HTTPHEADER, ["Authorization: Bearer {$token}"]);
$curl->_exec();
$curl->close();
$response = $curl->response;
return json_decode($response);
}
示例4: disable
public function disable($token, $id)
{
$curl = new Curl();
$curl->setopt(CURLOPT_URL, "https://v2.api.xapo.com/webhooks/{$id}/disable");
$curl->setopt(CURLOPT_RETURNTRANSFER, true);
$curl->setopt(CURLOPT_HEADER, false);
$curl->setopt(CURLOPT_POST, true);
$curl->setopt(CURLOPT_HTTPHEADER, ["Authorization: Bearer {$token}"]);
$curl->_exec();
$response = $curl->response;
$curl->close();
return $response;
}
示例5: new
public function new($redirect_uri)
{
$curl = new Curl();
$curl->setopt(CURLOPT_RETURNTRANSFER, true);
$curl->setopt(CURLOPT_HEADER, false);
$curl->setopt(CURLOPT_URL, 'https://v2.api.xapo.com/oauth2/token');
$curl->setopt(CURLOPT_POST, true);
$curl->setopt(CURLOPT_POSTFIELDS, "grant_type=client_credentials&redirect_uri={$redirect_uri}");
$curl->setopt(CURLOPT_HTTPHEADER, ['Content-Type: application/x-www-form-urlencoded', "Authorization: Basic {$this->hash}"]);
$curl->_exec();
$curl->close();
return json_decode($curl->response)->access_token;
}
示例6: update
public function update($token, $addr, $amount)
{
$curl = new Curl();
$curl->setopt(CURLOPT_URL, "https://v2.api.xapo.com/addresses/{$addr}?payment_threshold={$amount}");
$curl->setopt(CURLOPT_RETURNTRANSFER, true);
$curl->setopt(CURLOPT_HEADER, false);
$curl->setopt(CURLOPT_CUSTOMREQUEST, 'PATCH');
$curl->setopt(CURLOPT_POSTFIELDS, ['payment_threshold' => $amount]);
$curl->setopt(CURLOPT_HTTPHEADER, ["Authorization: Bearer {$token}"]);
$curl->_exec();
$response = $curl->response;
$curl->close();
return json_decode($response);
}