PHPackages                             aracoool/dhttp - 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. aracoool/dhttp

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

aracoool/dhttp
==============

Simple and lightweight HTTP client based cURL

2.0.6(5y ago)91902Apache-2.0PHPPHP &gt;=7.3CI failing

Since Feb 17Pushed 5y ago3 watchersCompare

[ Source](https://github.com/ARACOOOL/dHttp)[ Packagist](https://packagist.org/packages/aracoool/dhttp)[ RSS](/packages/aracoool-dhttp/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (10)Dependencies (1)Versions (23)Used By (0)

dHttp is a lightweight library to work with PHP Curl. Easy-to-use library!

[![Latest Stable Version](https://camo.githubusercontent.com/074e3a3cc86319194a04645ffa7021a1ec6295dad919e5b09e848c1bc2162507/68747470733a2f2f706f7365722e707567782e6f72672f617261636f6f6f6c2f64687474702f762f737461626c652e737667)](https://packagist.org/packages/aracoool/dhttp) [![Build Status](https://camo.githubusercontent.com/75041fc3af8d849a6635e7fc4bdb4082b4cb6f05823e1da0fccdfda3c2a41191/68747470733a2f2f7472617669732d63692e6f72672f415241434f4f4f4c2f64487474702e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/ARACOOOL/dHttp) [![Scrutinizer Code Quality](https://camo.githubusercontent.com/6c53e896d1cb871be068a1e801153513338cddb4ad48f7efed781af7091c57d8/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f415241434f4f4f4c2f64487474702f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/ARACOOOL/dHttp/?branch=master) [![License](https://camo.githubusercontent.com/1951ba4326a5b4624718a99007da41bfa1652f29542fee037d8a1e2435c4a764/68747470733a2f2f706f7365722e707567782e6f72672f617261636f6f6f6c2f64687474702f6c6963656e73652e737667)](https://packagist.org/packages/aracoool/dhttp)

[![SensioLabsInsight](https://camo.githubusercontent.com/41ee5c2e883b8376e0a454af45b0a5b18e6cdfee52b467188fa1f171648b353f/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f35373664363237392d316133622d343864622d393435632d3431653237323366653135612f6269672e706e67)](https://insight.sensiolabs.com/projects/576d6279-1a3b-48db-945c-41e2723fe15a)

Install
-------

[](#install)

- Using packagist/composer: The recommended way to install library is [through composer](http://getcomposer.org).

```
{
    "require": {
        "aracoool/dhttp" : "~2.0"
    }
}
```

- Cloning the git repository

Requirements
------------

[](#requirements)

dHttp (php curl library) works with PHP 7.3 7.4

Usage
-----

[](#usage)

### GET request:

[](#get-request)

```
required __DIR__ . '/vendor/autoload.php';

// http://website.com?param1=value1
$client = new dHttp\Client(['http://website.com', [
    'param1' => 'value1'
]], [CURLOPT_TIMEOUT => 5]);

$resp = $client->get();
// Get response code
var_dump($resp->getCode());
// Get response body
var_dump($resp->getBody());
// Get request errors
var_dump($resp->getErrors());
// Return response headers
var_dump($resp->getHeaders());
// Return a specific (text/html; charset=utf-8)
var_dump($resp->getHeader('Content-Type'));
```

### POST request:

[](#post-request)

```
required __DIR__ . '/vendor/autoload.php';

$client = new dHttp\Client('http://website.com');
$client->addOptions([CURLOPT_RETURNTRANSFER => false])
	->setCookie('/tmp/cookie.txt')
	->setUserAgent('Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.64 Safari/537.31')
	->post(array(
		'field1' => 'value1',
		'field2' => 'value2',
));
```

### Multithreaded query:

[](#multithreaded-query)

```
required __DIR__ . '/vendor/autoload.php';

$client = new dHttp\Client();
$response_array = $client->multi(array(
	new dHttp\Client('http://website1.com'),
	new dHttp\Client('http://website2.com', array(
		CURLOPT_USERAGENT => 'Mozilla/5.0 (Windows NT 5.1; rv:5.0.1) Gecko/20100101 Firefox/5.0.1',
		CURLOPT_TIMEOUT => 5,
	))
));

foreach($response_array as $item) {
	var_dump($item->getCode());
}
```

### Get cURL version:

[](#get-curl-version)

```
\dHttp\Client::v();
```

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~124 days

Recently: every ~0 days

Total

21

Last Release

1982d ago

Major Versions

1.6.0 → 2.0.02020-12-09

PHP version history (4 changes)1.2.1PHP &gt;=5.3.0

1.4.0PHP &gt;=5.4.0

1.6.0PHP &gt;=7.0

2.0.0PHP &gt;=7.3

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/539863?v=4)[Askar](/maintainers/ARACOOOL)[@ARACOOOL](https://github.com/ARACOOOL)

---

Top Contributors

[![ARACOOOL](https://avatars.githubusercontent.com/u/539863?v=4)](https://github.com/ARACOOOL "ARACOOOL (187 commits)")

---

Tags

curlhttphttp-clientphpphp-curlphp-curl-libraryhttpphpjsonclientrestcurlhttp clientweb servicerestfulrequests

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/aracoool-dhttp/health.svg)

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

###  Alternatives

[php-curl-class/php-curl-class

PHP Curl Class makes it easy to send HTTP requests and integrate with web APIs.

3.3k9.5M353](/packages/php-curl-class-php-curl-class)[ismaeltoe/osms

PHP library wrapper of the Orange SMS API.

4540.0k](/packages/ismaeltoe-osms)[zoonman/pixabay-php-api

PixabayClient is a PHP HTTP client library to access Pixabay's API

3354.7k](/packages/zoonman-pixabay-php-api)

PHPackages © 2026

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