Skip to content

Dreamer0x01/curl

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CURL

Simple cURL wrapper

License GitHub code size in bytes PHP

Installation

php composer.phar require --prefer-dist flankerspb/curl

Usage

$curl = new \fl\curl\Curl([
    CURLOPT_TIMEOUT        => 10,
    CURLOPT_CONNECTTIMEOUT => 5,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_AUTOREFERER    => true,
]);

$responseGet = $curl
    ->setQuery([
        'key1' => 'value',
        'key2' => 'value',
    ])
    ->get('https://www.site.com/');

$responsePost = $curl
    ->setBody([
        'key1' => 'value',
        'key2' => 'value',
    ], true)
    ->post('https://site.com/');
$curl = new \fl\curl\Curl();

$curl
    ->setHeader('key', 'value')
    ->setCookie('key', 'value')
    ->setProxy('socks5://user:[email protected]:1080')
;


$response = new class() implements \fl\curl\ResponseInterface {
    public function init($handle, array $options) : void
    {
        // TODO: Implement init() method.
    }
};


$curl->get('https://www.site.com/', $response);

About

Simple cURL wrapper

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%