以下是我的代码:
$client = new Client();
$api = 'some api';
$promise = $client->requestAsync(
'POST',
$api,
[
'form_params' => [
'shares' => $shares->pluck('uuid')->implode(','),
'bind_share' => $event->share->uuid
],
'headers' => [
'Accept' => 'application/json'
]
]
);
$promise->then(
function (ResponseInterface $response) {
Log::info('Response Body:'.$response->getBody()->__toString());
Log::info('Response status code:'.$response->getStatusCode());
},
function (RequestException $request) {
Log::info('Request Exception:', $request->getTrace());
}
);
我的问题是: (1)请求服务器未收到请求 (2)承诺解决或拒绝从未执行