https://github.com/guzzle/guzzle/issues/new
How do I pass data with Guzzle 6.0 asynchronous post?
My code is
$client = new Client();
$request = $client->postAsync($url, [
'json' => [
'company_name' => 'update Name'
],
]);
but i am checking in terminal is not calling any type of request
Async requests require that you either explicitly wait on them to complete, or that you tick an event loop until the request completes. What you are doing here is initiating a request but exiting the process before it completes. Also note that a response promise is returned, not a request.
$client = new Client();
$promise = $client->postAsync($url, ['json' => ['company_name' => 'update Name']]);
$response = $promise->wait();
If you use wait it ist async, Wait switches internaly to blocking requests.
Most helpful comment
If you use wait it ist async, Wait switches internaly to blocking requests.