PHP code example of bca / curl

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

    

bca / curl example snippets


$request = new CURL('http://example.com/');
$response = $request->get();

$request = new CURL('http://example.com/');
$response = $request
	->param('aaa', 'bbb')
	->param('xxx', 'yyy')
	->post();

echo $response;

$request = new CURL('http://example.com/');
$response = $request
    ->param('aaa', 'bbb')
    ->param('xxx', 'yyy')
    ->option(CURLOPT_PROXY, '10.0.0.1')
    ->auth('username', 'password', 'digest')
    ->delete();

echo $response;