PHP code example of havrylenko93 / curl-http-client

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

    

havrylenko93 / curl-http-client example snippets


$httpClient = new \CurlHttpClient\CurlHttpClient('https://www.php.net/manual/ru/function.curl-exec.php');
$result = $httpClient->execute();

$httpClient = new \CurlHttpClient\CurlHttpClient('http://127.0.0.1/api/companies/');

$result = $httpClient
    ->setPort(8000)
    ->responseToFile(fopen('/var/www/html/test/777.txt', 'w+'))
    ->execute();