本文整理汇总了PHP中HttpClient::do_post方法的典型用法代码示例。如果您正苦于以下问题:PHP HttpClient::do_post方法的具体用法?PHP HttpClient::do_post怎么用?PHP HttpClient::do_post使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HttpClient
的用法示例。
在下文中一共展示了HttpClient::do_post方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: bugreport
/**
* Send a bugreport.
*/
public function bugreport()
{
$params = new ParamStruct();
$params->add_required_param('bugreport', PDT_STRING);
$params->fill();
if (!$params->is_valid()) {
AjaxModul::return_code(AjaxModul::ERROR_INVALID_PARAMETER);
}
if (!file_exists($params->bugreport)) {
AjaxModul::return_code(AjaxModul::ERROR_INVALID_PARAMETER, null, true, 'Bugreport file not found');
}
$http = new HttpClient();
$http->do_post('https://www.phpminer.com/bugreport.php', array('bugreport' => base64_encode(file_get_contents($params->bugreport))), true);
AjaxModul::return_code(AjaxModul::SUCCESS);
}
示例2: catch
}
} catch (Exception $e) {
}
try {
// Send Push.co notification if enabled.
if ($pushco_enabled) {
$pushco_http = new HttpClient();
$pushco_http->do_post('https://api.push.co/1.0/push', array('api_key' => $pushco_api_key, 'api_secret' => $pushco_api_secret, 'notification_type' => $type, 'message' => $data), true);
}
} catch (Exception $e) {
}
try {
// Send custom post notification if enabled.
if ($post_enabled) {
$http = new HttpClient();
$http->do_post($post_url, array('type' => $type, 'msg' => $data));
}
} catch (Exception $e) {
}
}
}
// Loop through each rig which needs to be rebooted.
foreach ($rigs_to_reboot as $rig => $need_reboot) {
if (empty($need_reboot)) {
continue;
}
$rig_cfg = $config->get_rig($rig);
$rpc = new PHPMinerRPC($rig_cfg['http_ip'], $rig_cfg['http_port'], $rig_cfg['rpc_key'], 10);
$rpc->reboot();
}
}