Is There a 'Kirby-Way' to Send a POST Request?

The Remote class is your friend

In particular Remote::request(): https://getkirby.com/docs/reference/@/http/remote/request

Example:

$url = 'http:://your-api-url';
$data = [];
options = [
    'headers' => [
         'Authorization: Bearer ' . trim(option('mykey')),
         'Content-Type: application/json'
    ],
    'method'  => 'POST',
    'data'    => json_encode($data)
 ];
$response = Remote::request($url, $options);
3 Likes