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

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

oksuz/curl
==========

A Simple http library uses curl

1.0.2(11y ago)223MITPHPPHP &gt;=5.3.0

Since Nov 12Pushed 11y ago4 watchersCompare

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

READMEChangelog (3)DependenciesVersions (6)Used By (0)

A Simple Php Curl Library
=========================

[](#a-simple-php-curl-library)

[![Scrutinizer Code Quality](https://camo.githubusercontent.com/4b2a6b3607dd3b4f802bcaccdbe98f565653ae35a27482ab509bb34a4c9d9b72/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6f6b73757a2f6375726c2f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/oksuz/curl/?branch=master)[![Latest Stable Version](https://camo.githubusercontent.com/b40ca1bd8537801d6effc7522898e3ca260faf76bd0b972c1e27d4c0810e0372/68747470733a2f2f706f7365722e707567782e6f72672f6f6b73757a2f6375726c2f762f737461626c652e737667)](https://packagist.org/packages/oksuz/curl) [![Total Downloads](https://camo.githubusercontent.com/5a0a7d32adcac1cabb6bde93a2ee6eb485efee1062a14850ee5aafd4be7cd55e/68747470733a2f2f706f7365722e707567782e6f72672f6f6b73757a2f6375726c2f646f776e6c6f6164732e737667)](https://packagist.org/packages/oksuz/curl) [![Latest Unstable Version](https://camo.githubusercontent.com/e980e2991fb5e089ad4fe6f31609f4d8115bf831c72c939097320986514c1172/68747470733a2f2f706f7365722e707567782e6f72672f6f6b73757a2f6375726c2f762f756e737461626c652e737667)](https://packagist.org/packages/oksuz/curl) [![License](https://camo.githubusercontent.com/2f2b2249d8cf6240441c3218ee8ef554f9749cd16229e7dff5e7f375006044ce/68747470733a2f2f706f7365722e707567782e6f72672f6f6b73757a2f6375726c2f6c6963656e73652e737667)](https://packagist.org/packages/oksuz/curl)

Installation
------------

[](#installation)

[Composer](http://getcomposer.org) is recommended for installation.

In one command line :

```
composer require oksuz/curl dev-master

```

Or via editting your `composer.json`

```
{
    "require": {
        "oksuz/curl": "dev-master"
    }
}
```

```
composer update

```

Examples
--------

[](#examples)

### Single Requests

[](#single-requests)

#### GET

[](#get)

```
$cli = new \Oksuz\Curl\Request("http://example.org");
/** @var \Oksuz\Curl\Response $result */
$result = $cli->result();

//echo $result->getHeader();
//echo $result->getStatusCode();
echo $result->getResponse();
```

#### POST

[](#post)

```
$cli = new \Oksuz\Curl\Request("http://example.org")
/** @var \Oksuz\Curl\Response $result */
$result = $cli->post(array("username" => "foo", "password" => "bar"))
    ->addReferer("http://www.google.com/?q=example")
    ->setOpt(CURLOPT_USERAGENT, "firefox/2.0.16") // you can add php's CURL_CONSTANTS
    ->result();
```

Also available put and delete method

#### Runing Multiple Curl Requests

[](#runing-multiple-curl-requests)

```
$clients = array();
$clients[] = new \Oksuz\Curl\Request("http://example1.org");
$clients[] = new \Oksuz\Curl\Request("http://example2.org");
$clients[] = new \Oksuz\Curl\Request("http://example3.org");
$runner = new \Oksuz\Curl\Runner();
/** @var Array $result contains \Oksuz\Curl\Response */
$result = $runner->runMultiple($cli);
```

#### More Complex Example

[](#more-complex-example)

```
$curl = new \Oksuz\Curl\Request();
$response = $curl->url("http://www.example.org/login")
    ->post(array("username" => "user", "password" => "password"))
    ->addCookieSupport()
    //OR ->addCookieSupport("/path/to/cookiejar_cookiefile.txt")
    ->result();

if (200 == $response->getStatusCode()) {
    $resp = $curl->url("http://www.example.com/private_area")
    ->get(array("page" => 1, "do" => "show")) // http://www.example.com/private_area?page=1&do=show
    ->addHeader(array("HTTP_X_REQUESTED_WITH" => "XMLHttpRequest"))
    ->addCookie(array("cookie_name" => "cookie_value"))
    ->setBasicAuth("username", "password")
    ->result();

    var_dump($resp);
}
```

#### Default Values

[](#default-values)

```
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_USERAGENT => "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.104 Safari/537.36",
CURLOPT_HEADER => true,
CURLOPT_TIMEOUT => 10,
CURLOPT_RETURNTRANSFER => true,
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 75% 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 ~40 days

Total

5

Last Release

4042d ago

Major Versions

0.0.2 → 1.0.02014-11-16

### Community

Maintainers

![](https://www.gravatar.com/avatar/740eee4ff3c32abad95504c256c954b0f100cb66f96b0f341eec7a598d51155a?d=identicon)[oksuz](/maintainers/oksuz)

---

Top Contributors

[![oksuz](https://avatars.githubusercontent.com/u/1628550?v=4)](https://github.com/oksuz "oksuz (3 commits)")[![dermario](https://avatars.githubusercontent.com/u/8972530?v=4)](https://github.com/dermario "dermario (1 commits)")

---

Tags

curlhttp requestcrawlingscraping

### Embed Badge

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

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

###  Alternatives

[rmccue/requests

A HTTP library written in PHP, for human beings.

3.6k34.5M258](/packages/rmccue-requests)[php-http/curl-client

PSR-18 and HTTPlug Async client with cURL

48247.0M384](/packages/php-http-curl-client)[smi2/phpclickhouse

PHP ClickHouse Client

83510.1M71](/packages/smi2-phpclickhouse)[duzun/hquery

An extremely fast web scraper that parses megabytes of HTML in a blink of an eye. No dependencies. PHP5+

363146.3k4](/packages/duzun-hquery)[popphp/pop-http

Pop Http Component for Pop PHP Framework

1018.5k13](/packages/popphp-pop-http)

PHPackages © 2026

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