tzfrs/curl

A simple object-oriented wrapper of the PHP cURL extension.

Maintainers

Details

github.com/tzfrs/curl

Source

Issues

1.2 2015-06-01 08:09 UTC

This package is auto-updated.

Last update: 2024-11-13 02:59:00 UTC


README

A simple object-oriented wrapper of the PHP cURL extension.

Install

Install via composer:

{
    "require": {
        "tzfrs/curl": "dev-master"
    }
}

Run composer install.

Example usage

Perform a simple get request

require 'Curl.php';
$curl = new Curl;
$curl->get('http://tzfrs.de');

Perform a get request with parameters

$curl = new Curl;
$curl->get('http://tzfrs.de/', array(
    's' => 'searchterm',
));

Setting some more options.

$curl = new Curl;
$curl->setFollowlocation()
    ->setMaxredirs(15)
    ->get('http://tzfrs.de');
if ($curl->hasError) {
    print $curl->errorNo .': '. $curl->error;
}
else {
    print $curl->response;
}