PHP code example of thazh / api-light
1. Go to this page and download the library: Download thazh/api-light 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/ */
thazh / api-light example snippets
use Thazh\ApiLight\RestApi;
$options = array(
'content_type' => 'application/json',
'request_method' => 'POST',
'credentials' => array(
'testuser' => 'TestPwd@123',
),
'et code 200 for the success response */
$obj->code = 200;
/* Set API response data */
$obj->data = $output_data;
/* Print the API response data */
$obj->print();