PHPackages                             craa/php-curl-class - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. craa/php-curl-class

ActiveLibrary[HTTP &amp; Networking](/categories/http)

craa/php-curl-class
===================

PHP Curl Class is an object-oriented wrapper of the PHP cURL extension.

2.1.0(11y ago)035UnlicensePHPPHP &gt;=5.3

Since Jan 23Pushed 10y ago1 watchersCompare

[ Source](https://github.com/craa/php-curl-class)[ Packagist](https://packagist.org/packages/craa/php-curl-class)[ Docs](https://github.com/php-curl-class/php-curl-class)[ RSS](/packages/craa-php-curl-class/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (1)Versions (5)Used By (0)

php-curl-class
==============

[](#php-curl-class)

[![Build Status](https://camo.githubusercontent.com/addf39901e4f245b09b94c494b09dd47d9b75c23e7b266e52fcbf901915f52f1/68747470733a2f2f7472617669732d63692e6f72672f7068702d6375726c2d636c6173732f7068702d6375726c2d636c6173732e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/php-curl-class/php-curl-class)

PHP Curl Class is an object-oriented wrapper of the PHP cURL extension.

### Composer

[](#composer)

```
$ composer require php-curl-class/php-curl-class

```

### Quick Start and Examples

[](#quick-start-and-examples)

```
require 'Curl.php';

use \Curl\Curl;

$curl = new Curl();
$curl->get('http://www.example.com/');
```

```
$curl = new Curl();
$curl->get('http://www.example.com/search', array(
    'q' => 'keyword',
));
```

```
$curl = new Curl();
$curl->post('http://www.example.com/login/', array(
    'username' => 'myusername',
    'password' => 'mypassword',
));
```

```
$curl = new Curl();
$curl->setBasicAuthentication('username', 'password');
$curl->setUserAgent('');
$curl->setReferrer('');
$curl->setHeader('X-Requested-With', 'XMLHttpRequest');
$curl->setCookie('key', 'value');
$curl->get('http://www.example.com/');

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

var_dump($curl->request_headers);
var_dump($curl->response_headers);
```

```
$curl = new Curl();
$curl->setOpt(CURLOPT_SSL_VERIFYPEER, false);
$curl->get('https://encrypted.example.com/');
```

```
$curl = new Curl();
$curl->put('http://api.example.com/user/', array(
    'first_name' => 'Zach',
    'last_name' => 'Borboa',
));
```

```
$curl = new Curl();
$curl->patch('http://api.example.com/profile/', array(
    'image' => '@path/to/file.jpg',
));
```

```
$curl = new Curl();
$curl->patch('http://api.example.com/profile/', array(
    'image' => new CURLFile('path/to/file.jpg'),
));
```

```
$curl = new Curl();
$curl->delete('http://api.example.com/user/', array(
    'id' => '1234',
));
```

```
// Enable gzip compression.
$curl = new Curl();
$curl->setOpt(CURLOPT_ENCODING , 'gzip');
$curl->get('https://www.example.com/image.png');
```

```
// Case-insensitive access to headers.
$curl = new Curl();
$curl->get('https://www.example.com/image.png');
echo $curl->response_headers['Content-Type'] . "\n"; // image/png
echo $curl->response_headers['CoNTeNT-TyPE'] . "\n"; // image/png
```

```
$curl->close();
```

```
// Example access to curl object.
curl_set_opt($curl->curl, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1');
curl_close($curl->curl);
```

```
// Requests in parallel with callback functions.
$curl = new Curl();
$curl->setOpt(CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1');

$curl->success(function($instance) {
    echo 'call to "' . $instance->url . '" was successful. response was' . "\n";
    echo $instance->response . "\n";
});
$curl->error(function($instance) {
    echo 'call to "' . $instance->url . '" was unsuccessful.' . "\n";
    echo 'error code:' . $instance->error_code . "\n";
    echo 'error message:' . $instance->error_message . "\n";
});
$curl->complete(function($instance) {
    echo 'call completed' . "\n";
});

$curl->get(array(
    'https://duckduckgo.com/',
    'https://search.yahoo.com/search',
    'https://www.bing.com/search',
    'http://www.dogpile.com/search/web',
    'https://www.google.com/search',
    'https://www.wolframalpha.com/input/',
), array(
    'q' => 'hello world',
));
```

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 90.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~54 days

Total

4

Last Release

4355d ago

Major Versions

1.0.1 → 2.0.02014-04-12

### Community

Maintainers

![](https://www.gravatar.com/avatar/00b659afcdbf5437e03331c722e404f42ad5a6c9be39a4ed6ffa40d6c93727a6?d=identicon)[craa](/maintainers/craa)

---

Top Contributors

[![zachborboa](https://avatars.githubusercontent.com/u/1083146?v=4)](https://github.com/zachborboa "zachborboa (194 commits)")[![zborboa-g](https://avatars.githubusercontent.com/u/6154360?v=4)](https://github.com/zborboa-g "zborboa-g (8 commits)")[![rockerBOO](https://avatars.githubusercontent.com/u/15027?v=4)](https://github.com/rockerBOO "rockerBOO (2 commits)")[![user52](https://avatars.githubusercontent.com/u/3287452?v=4)](https://github.com/user52 "user52 (2 commits)")[![failpunk](https://avatars.githubusercontent.com/u/1109167?v=4)](https://github.com/failpunk "failpunk (2 commits)")[![Yahasana](https://avatars.githubusercontent.com/u/97450?v=4)](https://github.com/Yahasana "Yahasana (1 commits)")[![Pezmc](https://avatars.githubusercontent.com/u/507155?v=4)](https://github.com/Pezmc "Pezmc (1 commits)")[![craa](https://avatars.githubusercontent.com/u/8178776?v=4)](https://github.com/craa "craa (1 commits)")[![DaniSancas](https://avatars.githubusercontent.com/u/3708682?v=4)](https://github.com/DaniSancas "DaniSancas (1 commits)")[![maisumakun](https://avatars.githubusercontent.com/u/7711783?v=4)](https://github.com/maisumakun "maisumakun (1 commits)")[![bangbang93](https://avatars.githubusercontent.com/u/3430784?v=4)](https://github.com/bangbang93 "bangbang93 (1 commits)")

---

Tags

phpcurlclass

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/craa-php-curl-class/health.svg)

```
[![Health](https://phpackages.com/badges/craa-php-curl-class/health.svg)](https://phpackages.com/packages/craa-php-curl-class)
```

###  Alternatives

[stefangabos/zebra_curl

A high performance solution for making multiple HTTP requests concurrently, asynchronously from your PHP projects using cURL

21472.0k2](/packages/stefangabos-zebra-curl)[ismaeltoe/osms

PHP library wrapper of the Orange SMS API.

4540.5k](/packages/ismaeltoe-osms)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
