|
|
|
@ -2899,3 +2899,22 @@ function post_async($url="'http://47.111.118.107:9501/game-event/recharge'", $da
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function post_task($url, $data) {
|
|
|
|
|
$client = new Client([
|
|
|
|
|
'base_uri' => C('TASK_URL'),
|
|
|
|
|
'timeout' => 5.0,
|
|
|
|
|
]);
|
|
|
|
|
$promise = $client->requestAsync('POST', $url, [
|
|
|
|
|
'form_params' => $data
|
|
|
|
|
]);
|
|
|
|
|
$promise->then(
|
|
|
|
|
function (ResponseInterface $res) {
|
|
|
|
|
echo $res->getStatusCode() . PHP_EOL;
|
|
|
|
|
},
|
|
|
|
|
function (RequestException $e) {
|
|
|
|
|
echo $e->getMessage() . PHP_EOL;
|
|
|
|
|
echo $e->getRequest()->getMethod();
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|