PHP code example of larexsetch / http-client-binder

1. Go to this page and download the library: Download larexsetch/http-client-binder 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/ */

    

larexsetch / http-client-binder example snippets




/** @var YourClientInterface $client */
$client = 
    \HttpClientBinder\Fabrics\BinderBuilder::builder()
        ->temporaryDirectory("/path/to/temporary/directory") // Default /tmp
        ->encoder($encoder) // Custom encoder 
        ->decoder($decoder) // Custom decoder
        ->target(YourClientInterface::class, $baseUrl) // $baseUrl may be declare by annotation @Client(baseUrl="http://example.com")
        ->getClient();