PHP code example of smalldb / smalldb-rest

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

    

smalldb / smalldb-rest example snippets


HTTP GET /api-v1.php/blogpost/1

HTTP GET /api-v1.php/blogpost/1!edit

HTTP POST /api-v1.php/blogpost/1!edit
Content-Type: application/x-www-form-urlencoded

args[0][title]=Some%20title&args[1][text]=Lorem%20ipsum

HTTP GET /api-v1.php/?type=blogpost

HTTP GET /api-v1-diagram.php?machine=blogpost&format=png

<img src="api-v1-diagram.php?machine=blogpost&format=png" alt="state diagram">