PHP code example of jleagle / curl-wrapper

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

    

jleagle / curl-wrapper example snippets


$response = Curl::get(URL)->run();
$response = Curl::get(URL, ['k' => 'v'])->run();

$response = Request::i()
  ->setUrl(URL)
  ->setPost()
  ->setBasicAuth('username', 'password')
  ->setPostFields(['k' => 'v'])
  ->run();

$response = Curl::get(URL)->run();

$connectTime = $response->getConnectTime();
$httpCode = $response->getHttpCode();
$error = $response->getErrorMessage();