PHPackages                             azurre/php-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. azurre/php-http-client

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

azurre/php-http-client
======================

Simple http client

1.1.0(1y ago)0971MITPHPPHP &gt;=8.0CI failing

Since Aug 1Pushed 1y ago1 watchersCompare

[ Source](https://github.com/azurre/php-http-client)[ Packagist](https://packagist.org/packages/azurre/php-http-client)[ Docs](https://github.com/azurre/php-http-client)[ RSS](/packages/azurre-php-http-client/feed)WikiDiscussions master Synced today

READMEChangelog (9)Dependencies (1)Versions (10)Used By (1)

Simple http client
==================

[](#simple-http-client)

A small, lightweight, zero-dependency HTTP client designed to simplify sending HTTP requests effortlessly

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

[](#installation)

```
composer require azurre/php-http-client
```

Usage
-----

[](#usage)

### GET request

[](#get-request)

```
require __DIR__ . '/vendor/autoload.php';
use \Azurre\Component\Http\Client;

$request = Client::create()->get('http://example.com/')->execute();
echo $request->getResponse();
```

### POST request

[](#post-request)

```
require __DIR__ . '/vendor/autoload.php';
use \Azurre\Component\Http\Client;

$data = [
    'key' => 'some key',
    'comment' => 'Some string'
];
try {
    $request = Client::create()->post('http://example.com/', $data)->execute();
} catch (\Exception $e) {
    echo $e->getMessage();
}
var_dump($request->getStatusCode());
var_dump($request->getResponseCookies());
var_dump($request->getResponseHeaders());
echo $request->getResponse();
```

Output

```
int(200)
Array
(
    [Cache-Control] => max-age=604800
    [Cookies] => Array
        (
            [sid] => d80242705b7878712f36d8f0
        )
    [Content-Type] => text/html; charset=UTF-8
    [Date] => Thu, 27 Dec 2018 18:35:01 GMT
    [Etag] => "1541025663+ident"
    [Expires] => Thu, 03 Jan 2019 18:35:01 GMT
    [Last-Modified] => Fri, 09 Aug 2013 23:54:35 GMT
    [Server] => ECS (dca/2470)
    [Vary] => Accept-Encoding
    [X-Cache] => HIT
    [Content-Length] => 1270
    [Connection] => close
)

```

### JSON API request

[](#json-api-request)

```
require __DIR__ . '/vendor/autoload.php';
use \Azurre\Component\Http\Client;

$data = [
    'string' => 'Some string',
    'numbers' => [1, 2, 3]
];
try {
    $request = Client::create();
    $request
        ->post('http://example.com/', $data)
        ->setProxy('tcp://192.168.0.2:3128')
        ->setHeader('X-SECRET-TOKEN', 'f36d8f0f53aefb121531567849')
        ->setCookies('cookieName','cookieValue')
        ->verifySSL(false) // Accept sef-signed certificates
        ->setTimeout(10)
        ->setIsJson()
        ->execute();
} catch (\Exception $e) {
    echo $e->getMessage();
}
```

### File download (No memory leak)

[](#file-download-no-memory-leak)

```
$progressCallback = function ($downloaded, $total) {
    if ($total) {
        $percent = round(($downloaded / $total) * 100, 2);
        echo "Downloaded: $downloaded / $total bytes ($percent%)\r\n";
    } else {
        echo "Downloaded: $downloaded bytes\r\n";
    }
};
$dst = sys_get_temp_dir() . DIRECTORY_SEPARATOR . '__' . time() . '_test.mp4';
//$testUrl = 'https://freetestdata.com/wp-content/uploads/2022/02/Free_Test_Data_1MB_MP4.mp4';
$testUrl = 'https://freetestdata.com/wp-content/uploads/2022/02/Free_Test_Data_10MB_MP4.mp4';

$time = microtime(true);
$request1 = Client::create()->download($testUrl, $dst, $progressCallback);
//$request2 = Client::create()->get($testUrl)->execute();

$duration = round(microtime(true) - $time, 2);
$memory = round(memory_get_peak_usage() / (1024 * 1024), 2);
echo PHP_EOL;
echo "Memory usage: {$memory} Mb" . PHP_EOL;
echo "Duration: {$duration} sec" . PHP_EOL;
```

```
Memory usage: 0.72 Mb
Duration: 2.35 sec

```

vs

```
Memory usage: 12.62 Mb
Duration: 3.59 sec

```

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance39

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity73

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 ~289 days

Recently: every ~364 days

Total

9

Last Release

528d ago

PHP version history (2 changes)1.0.3PHP &gt;=5.4

1.1.0PHP &gt;=8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/f5bbeafb1d06ec9c1ba940980a19a3fd3902cef3499a446726677986be73b0ec?d=identicon)[a.milenin](/maintainers/a.milenin)

---

Top Contributors

[![azurre](https://avatars.githubusercontent.com/u/2183975?v=4)](https://github.com/azurre "azurre (14 commits)")

---

Tags

httpjsonapiclienthttp client

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/azurre-php-http-client/health.svg)

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

###  Alternatives

[aplus/http-client

Aplus Framework HTTP Client Library

2161.6M1](/packages/aplus-http-client)[vinelab/http

An http library developed for the laravel framework. aliases itself as HttpClient

59300.2k11](/packages/vinelab-http)[basecrm/basecrm-php

BaseCRM Official API V2 library client for PHP

221.0M](/packages/basecrm-basecrm-php)[ismaeltoe/osms

PHP library wrapper of the Orange SMS API.

4540.0k](/packages/ismaeltoe-osms)[e-moe/guzzle6-bundle

Integrates Guzzle 6 into your Symfony application

11259.2k](/packages/e-moe-guzzle6-bundle)[jsor/hal-client

A lightweight client for consuming and manipulating Hypertext Application Language (HAL) resources.

2425.9k1](/packages/jsor-hal-client)

PHPackages © 2026

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