PHP code example of netflex / http

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

    

netflex / http example snippets




use Netflex\Http\Client;

$client = new Client();

$post = $client->get('https://jsonplaceholder.typicode.com/posts/1');

echo $post->title;

$post = $client->get('https://jsonplaceholder.typicode.com/posts/1', true);

echo $post['title'];



use Netflex\Http\Facades\Http;

$post = Http::get('https://jsonplaceholder.typicode.com/posts/1');

echo $post->title;



use Http;

$post = Http::get('https://jsonplaceholder.typicode.com/posts/1');

echo $post->title;