1. Go to this page and download the library: Download marcus-campos/maestro library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
public function postNotification()
{
return $this
->get()
->setEndPoint('package/')
->headers([
'Content-Type' => 'application/json'
])
->body([
'message' => 'Tanks for all.',
'id' => [1]
])
->send()
->assoc()
->parse()['name'];
}
public function postNotification()
{
$response = $this
->get()
->setEndPoint('package/')
->headers([
'Content-Type' => 'application/json'
])
->body([
'message' => 'Tanks for all.',
'id' => [1]
])
->send();
if($response->status() === 200) {
$db->save($response->parse()); // any code to work with response body
}
}
public function postNotification()
{
return $this
->get()
->setEndPoint('package/')
->headers([
'Content-Type' => 'application/json'
])
->body([
'message' => 'Tanks for all.',
'id' => [1]
])
->sendAsync()
->wait()
->parse()
->name;
}