PHPackages                             rockerboo/curl - 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. rockerboo/curl

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

rockerboo/curl
==============

Curl class for php

014PHP

Since Jan 2Pushed 12y ago1 watchersCompare

[ Source](https://github.com/rockerBOO/curl)[ Packagist](https://packagist.org/packages/rockerboo/curl)[ RSS](/packages/rockerboo-curl/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (3)Used By (0)

Curl
====

[](#curl)

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

### Install

[](#install)

Add the following lines to `composer.json`

```
{
    "require": {
        "rockerboo/curl": "dev-master",
    }
}

```

Update composer

```
composer update

```

Require the composer autoloader, if you haven't already

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

```

### Quick Start and Examples

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

```
use rockerboo\curl\Curl;

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

```
use rockerboo\curl\Curl;

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

```
use rockerboo\curl\Curl;

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

```
use rockerboo\curl\Curl;

$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 $curl->error_code;
}
else {
    echo $curl->response;
}

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

```
use rockerboo\curl\Curl;

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

```
use rockerboo\curl\Curl;

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

```
use rockerboo\curl\Curl;

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

```
use rockerboo\curl\Curl;

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

```
$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);
```

```
use rockerboo\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 was successful. response was' . "\n";
    echo $instance->response . "\n";
});
$curl->error(function($instance) {
    echo 'call 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',
    'http://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

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 68.3% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/1f954ec4fd7b481b7b577f7e8ff32cfb5091e299d05f3f8886f805e4c3ec3b2a?d=identicon)[rockerBOO](/maintainers/rockerBOO)

---

Top Contributors

[![zachborboa](https://avatars.githubusercontent.com/u/1083146?v=4)](https://github.com/zachborboa "zachborboa (28 commits)")[![rockerBOO](https://avatars.githubusercontent.com/u/15027?v=4)](https://github.com/rockerBOO "rockerBOO (10 commits)")[![user52](https://avatars.githubusercontent.com/u/3287452?v=4)](https://github.com/user52 "user52 (2 commits)")[![DaniSancas](https://avatars.githubusercontent.com/u/3708682?v=4)](https://github.com/DaniSancas "DaniSancas (1 commits)")

### Embed Badge

![Health badge](/badges/rockerboo-curl/health.svg)

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

###  Alternatives

[friendsofsymfony/rest-bundle

This Bundle provides various tools to rapidly develop RESTful API's with Symfony

2.8k73.3M319](/packages/friendsofsymfony-rest-bundle)[php-http/discovery

Finds and installs PSR-7, PSR-17, PSR-18 and HTTPlug implementations

1.3k309.5M1.2k](/packages/php-http-discovery)[nyholm/psr7

A fast PHP7 implementation of PSR-7

1.3k235.4M2.4k](/packages/nyholm-psr7)[pusher/pusher-php-server

Library for interacting with the Pusher REST API

1.5k94.8M293](/packages/pusher-pusher-php-server)[spatie/crawler

Crawl all internal links found on a website

2.8k16.3M52](/packages/spatie-crawler)[react/http

Event-driven, streaming HTTP client and server implementation for ReactPHP

78126.4M414](/packages/react-http)

PHPackages © 2026

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