PHPackages                             arhitector/http-curl-client - 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. arhitector/http-curl-client

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

arhitector/http-curl-client
===========================

cURL client for PHP-HTTP

1.3.0(10y ago)065MITPHPPHP &gt;=5.5

Since Nov 11Pushed 10y ago1 watchersCompare

[ Source](https://github.com/jack-theripper/curl-client)[ Packagist](https://packagist.org/packages/arhitector/http-curl-client)[ Docs](http://php-http.org)[ RSS](/packages/arhitector-http-curl-client/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (9)Versions (13)Used By (0)

Curl client for PHP HTTP
========================

[](#curl-client-for-php-http)

[![Latest Version](https://camo.githubusercontent.com/02b4e52edb80ad30893101fa2b4eaa01cdf8c76e548e2470e4b55d1dd6d654de/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f7068702d687474702f6375726c2d636c69656e742e7376673f7374796c653d666c61742d737175617265)](https://github.com/php-http/curl-client/releases)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![Build Status](https://camo.githubusercontent.com/19a48beff87212fd749bd3a63082847bf9cae77a9ef0e82fa26e527433194811/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f7068702d687474702f6375726c2d636c69656e742e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/php-http/curl-client)[![Code Coverage](https://camo.githubusercontent.com/a1fe566de6640fcffee6551def9683c53e0c9b833b27fe5c48af2c828cf7e320/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f7068702d687474702f6375726c2d636c69656e742e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/php-http/curl-client)[![Quality Score](https://camo.githubusercontent.com/f515e8b206de610650a7400ef6adfdfece5bd06f082feeb4554f6018a99f1f23/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f7068702d687474702f6375726c2d636c69656e742e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/php-http/curl-client)[![Total Downloads](https://camo.githubusercontent.com/31a29d4f93256d07bfc966c44044b142252e35cbf8abb78e84a6e84b4dec93ff/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7068702d687474702f6375726c2d636c69656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/arhitector/http-curl-client)

The client for sending requests of PSR-7. The cURL client use the cURL PHP extension which must be activated in your `php.ini`.

Differences from
----------------------------------------------------------

[](#differences-from-httpsgithubcomphp-httpcurl-client)

- Support custom method, such as "MOVE", "COPY", "PROPFIND", "MKCOL" etc. (it is actual by operation with WebDav)
- Fixed supports transmission of big bodies (upload and download).
- Full support of native streaming filters, such as 'zlib.deflate' etc.
- Fixed bug with queues in async request.
- Doesn't lead to hangup of the server, in case of the inexact size of a flow.
- More friendly api.
- Inheritance support.
- You can use options "CURLOPT\_READFUNCTION" and "CURLOPT\_WRITEFUNCTION".
- Support of an native option "CURLOPT\_FOLLOWLOCATION". (if you need support cookie with redirect - use "CURLOPT\_COOKIEJAR" and "CURLOPT\_COOKIEFILE")
- Support send "PSR-7 Response".
- More correct support of header "Expect"

Install
-------

[](#install)

Via Composer

```
$ composer require arhitector/http-curl-client:~1.3

```

Quickstart
----------

[](#quickstart)

For example with Zend/Diactoros:

```
use Http\Message\MessageFactory\DiactorosMessageFactory;
use Http\Message\StreamFactory\DiactorosStreamFactory;

$client = new Mackey\Http\Client\Curl\Client(new DiactorosMessageFactory(), new DiactorosStreamFactory(), [
  // array, set default curl options, if you need
  CURLOPT_SSL_VERIFYPEER => false
]);
```

Send request

```
$request = new Zend\Diactoros\Request('', 'GET');

$response = $client->sendRequest($request, [
  // curl options for 1 request, if you need
  CURLOPT_FOLLOWLOCATION => true
]);
```

Send async request

```
$request = new Zend\Diactoros\Request('', 'GET');

$promise = $client->sendAsyncRequest($request);
$promise->then(
  function (ResponseInterface $response) {
    // The success callback

    return $response;
  },
  function (\Exception $exception) {
    // The failure callback

    throw $exception;
  }
);

// other request
// $promise = $client->sendAsyncRequest($request);

try {
    $response = $promise->wait();
} catch (\Exception $exception) {
    echo $exception->getMessage();
}
```

Send response

```
// example just send file in output
$stream = new \Zend\Diactoros\Stream('file/to/send.txt');
$response = new \Zend\Diactoros\Response($stream, 200);

$client->sendResponse($response);

// or send for download
$response = $response->withHeader('Content-Description', 'File Transfer')
    ->withHeader('Content-Type', 'application/octet-stream')
    ->withHeader('Content-Disposition', 'attachment; filename=filename.txt')
    ->withHeader('Content-Transfer-Encoding', 'binary');

$client->sendResponse($response);
```

Documentation
-------------

[](#documentation)

Please see the [official documentation](http://docs.php-http.org/en/latest/clients/curl-client.html).

Testing
-------

[](#testing)

```
$ composer test
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) and [CONDUCT](CONDUCT.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please contact us at .

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 89.6% 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 ~12 days

Total

12

Last Release

3696d ago

Major Versions

v0.7.0 → v1.0.02016-01-28

### Community

Maintainers

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

---

Top Contributors

[![mekras](https://avatars.githubusercontent.com/u/192067?v=4)](https://github.com/mekras "mekras (69 commits)")[![jack-theripper](https://avatars.githubusercontent.com/u/6401841?v=4)](https://github.com/jack-theripper "jack-theripper (4 commits)")[![dbu](https://avatars.githubusercontent.com/u/76576?v=4)](https://github.com/dbu "dbu (2 commits)")[![joelwurtz](https://avatars.githubusercontent.com/u/90466?v=4)](https://github.com/joelwurtz "joelwurtz (1 commits)")[![shulard](https://avatars.githubusercontent.com/u/482993?v=4)](https://github.com/shulard "shulard (1 commits)")

---

Tags

httpcurl

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/arhitector-http-curl-client/health.svg)

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

###  Alternatives

[rmccue/requests

A HTTP library written in PHP, for human beings.

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

PSR-18 and HTTPlug Async client with cURL

48247.0M382](/packages/php-http-curl-client)[nategood/httpful

A Readable, Chainable, REST friendly, PHP HTTP Client

1.8k17.2M264](/packages/nategood-httpful)[mashape/unirest-php

Unirest PHP

1.3k9.7M157](/packages/mashape-unirest-php)[smi2/phpclickhouse

PHP ClickHouse Client

83510.1M70](/packages/smi2-phpclickhouse)[pear/http_request2

Provides an easy way to perform HTTP requests.

764.2M48](/packages/pear-http-request2)

PHPackages © 2026

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