PHP code example of farhanaliofficial / requests

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

    

farhanaliofficial / requests example snippets




arhanAliOfficial\Requests;

$url = "https://example.com";

// Make Object of Requests
$reqs = new Requests();

// Using default options
$r = $reqs->get($url);
echo "Response 1: " . $r->getBody() . "\n";

// Overriding options
$options = [
    'allow_redirects' => false,
    'ssl_verification' => false,
];

$r2 = $reqs->get($url, [], $options);
echo "Response 2: " . $r2->getBody() . "\n";