PHP code example of ausus / api-runtime

1. Go to this page and download the library: Download ausus/api-runtime 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/ */

    

ausus / api-runtime example snippets



use Ausus\Api\Runtime\Http\RuntimeApi;
use Ausus\Api\Runtime\Http\RequestContextFactory;

$api = new RuntimeApi($repository, $engine, $driver, new RequestContextFactory(new DateTimeImmutable()));
$res = $api->dispatch('GET', '/api/entities/customer/projections/board',
    ['X-Tenant-ID' => 'acme', 'X-Actor-Type' => 'user']);
// $res === ['status' => 200, 'body' => [...]]