PHP code example of appstract / lush-http

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

    

appstract / lush-http example snippets

 php
    // Create a new instance
    $lush = new Lush();
    
    // Make a requests
    $response = $lush->url('http://example.com', ['id' => 3])
                        ->headers(['X-some-header' => 'some-value'])
                        ->get(); // Method (get, post, put, etc.)
    
    // Response returns JSON or XML?
    // then you can directly access it's properties
    echo $response->name;