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

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

havrylenko93/curl-http-client
=============================

Simple curl http client

v1.0(7y ago)15MITPHPPHP ^7.1

Since Mar 26Pushed 7y ago1 watchersCompare

[ Source](https://github.com/Havrylenko93/CurlHttpClient2018)[ Packagist](https://packagist.org/packages/havrylenko93/curl-http-client)[ RSS](/packages/havrylenko93-curl-http-client/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependenciesVersions (2)Used By (0)

How to install? `composer require havrylenko93/curl-http-client`

How to use?

Case 1. Simple.

```
$httpClient = new \CurlHttpClient\CurlHttpClient('https://www.php.net/manual/ru/function.curl-exec.php');
$result = $httpClient->execute();

```

Case 2. Additional parameters.

```
$httpClient = new \CurlHttpClient\CurlHttpClient('http://127.0.0.1/api/companies/');

$result = $httpClient
    ->setPort(8000)
    ->setConnectTimeout(1)
    ->acceptJson()
    ->execute();

```

Case 3. Re-sending requests with pauses. If resource is unavailable then will be sent 3 request (setCountOfAttempts) with a gap between them in 4 seconds (setTimeBetweenAttempts). If any request is not finished by success status then will be throw an exception

```
$httpClient = new \CurlHttpClient\CurlHttpClient('http://127.0.0.1/api/companies/');

$result = $httpClient
    ->setPort(8000)
    ->setCountOfAttempts(3)
    ->setTimeBetweenAttempts(1)
    ->acceptJson()
    ->execute();

```

Case 4. Response to file.

```
$httpClient = new \CurlHttpClient\CurlHttpClient('http://127.0.0.1/api/companies/');

$result = $httpClient
    ->setPort(8000)
    ->responseToFile(fopen('/var/www/html/test/777.txt', 'w+'))
    ->execute();

```

All methods:

```
public function setCountOfAttempts(int $count): CurlInterface

public function setTimeBetweenAttempts(int $seconds): CurlInterface

public function responseStatusIsOk(): bool

public function responseStatusCode(): int

public function getOptions(): array

public function setOption(int $optionKey, $optionValue): CurlInterface

public function setOptions(array $options): CurlInterface

public function init($url): CurlInterface

public function execute()

public function setUrl(string $url)

public function responseToFile($fileDescriptor)

public function setPort(int $port)

public function setConnectTimeout(int $seconds)

public function setTimeout(int $seconds)

public function setUserAgent(string $userAgent)

public function setPostFields(string $postFields)

public function acceptJson()

public function acceptXml()

public function setBasicAuthentication(string $username, string $password = '')

public function setHeaders(array $headers)

public function setProgressCallback($callback)

public function setContentType($contentType)

```

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

2653d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7eaed6e4a5eb66ffdeda17d5c4d29ff259bd3d264819b02ffd1f220ecffe36b8?d=identicon)[gavrilenko93](/maintainers/gavrilenko93)

---

Top Contributors

[![shavrylenko-livegenic](https://avatars.githubusercontent.com/u/55877026?v=4)](https://github.com/shavrylenko-livegenic "shavrylenko-livegenic (4 commits)")

---

Tags

httpphpclientcurlhttp clientretryapi clientphp-curlphp-curl-library

### Embed Badge

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

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

###  Alternatives

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

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

3.3k9.8M372](/packages/php-curl-class-php-curl-class)[smi2/phpclickhouse

PHP ClickHouse Client

84711.1M80](/packages/smi2-phpclickhouse)[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)
