PHP code example of kepsondiaz / httpjsonbridge

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

    

kepsondiaz / httpjsonbridge example snippets


composer 

/**
 * Response with status code 400.
 */
return (new \Kepsondiaz\HttpJsonBridge\HttpJsonBridge)->badRequestApiResponse($message);

/**
 * Response with status code 200.
 */
return (new \Kepsondiaz\HttpJsonBridge\HttpJsonBridge)->okApiResponse($data, $message);

/**
 * Response with status code 404.
 */
return (new \Kepsondiaz\HttpJsonBridge\HttpJsonBridge)->notFoundApiResponse();

/**
 * Response with status code 401.
 */
return (new \Kepsondiaz\HttpJsonBridge\HttpJsonBridge)->unauthorizedApiResponse();