PHP code example of inigo-aldama / inmovilla-api-proxy

1. Go to this page and download the library: Download inigo-aldama/inmovilla-api-proxy 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/ */

    

inigo-aldama / inmovilla-api-proxy example snippets


   

   villa\ApiClient\ApiClientConfig;
   use Inmovilla\Proxy\ProxyService;
   use GuzzleHttp\Client as GuzzleClient;
   use GuzzleHttp\Psr7\HttpFactory;

   $serverConfig = ApiClientConfig::fromIniFile(__DIR__ . '/config/api.ini');
   $httpClient = new GuzzleClient();
   $requestFactory = new HttpFactory();

   $proxyService = new ProxyService($httpClient, $requestFactory, $serverConfig);

   $input = file_get_contents('php://input');
   $response = $proxyService->handleRequest($input);

   header('Content-Type: application/json');
   echo json_encode($response);