PHP Curl Class

PHP Curl Class: an object-oriented wrapper for curl functions. Supports REST request methods: GET, POST, PUT, PATCH, and DELETE. Examples:

require __DIR__ . '/vendor/autoload.php';

$curl = new Curl();
$curl->setUserAgent('SomeBot (+https://www.example.com/bot.html)');
$curl->get('https://www.example.com/');

if ($curl->error) {
    echo 'Error: ' . $curl->errorCode . ': ' . $curl->errorMessage;
} else {
    echo $curl->response;
}

var_dump($curl->requestHeaders);
var_dump($curl->responseHeaders);

More examples and download at https://github.com/php-curl-class/php-curl-class

View this page on GitHub.
Posted .

Comments

Leave a Reply