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

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

webikevn/http-client
====================

Factory wrapper around Guzzle HTTP Client to simplify things for lazy dev

1.0.6(5y ago)1328MITPHPPHP ^7.3CI failing

Since Jul 6Pushed 5y ago1 watchersCompare

[ Source](https://github.com/webikevn/http-client)[ Packagist](https://packagist.org/packages/webikevn/http-client)[ RSS](/packages/webikevn-http-client/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (6)Dependencies (3)Versions (7)Used By (0)

http-client
===========

[](#http-client)

Wrapper around Guzzle HTTP Client to simplify bootstrapping

Simplest example in a Laravel app - ready to copy-paste and run

```
use Webikevn\HttpClient\Factory;

// register factory in IoC with default app logger
app()->bind(Factory::class, fn () => new Factory(app()->environment('testing'), app('log')->driver()));

// then inject or resolve wherever you need
$httpClient = app(Factory::class)
  ->withOptions(['base_uri' => 'https://api.github.com'])
  ->enableRetries()
  ->enableLogging()
  ->make();

$httpClient->get('users/GiangBeo');

// et voila! Automatic retries in case of server errors and logging out of the box:
[2020-05-22 12:38:32] local.INFO: GET https://api.github.com/users/GiangBeo HTTP/1.1 200 (1351 application/json; charset=utf-8) {"request": , "response": {
  "login": "GiangBeo",
  "blog": "https://rivercrane.vn",
  "location": "Vietnam",
  ...
  }
}
```

Raw example with more customization:

```
// Raw example
$logger = new Logger('HttpLogger');
$logger->pushHandler(
  new StreamHandler('/path/to/the/log/' . date('Y-m-d') . '.log'))
);

$clientFactory = new Factory($fakeRequests, $logger);
$httpClient = $clientFactory
  ->withOptions([
    'base_uri' => 'https://api.github.com',
    'headers' => [
      'User-Agent' => 'My Awesome Client',
    ],
  ])
  ->enableRetries($retries = 3, $delayInSec = 1, $minStatus = 500)
  ->enableLogging($customLogFormat)
  ->withMiddleware($customGuzzleMiddleware)
  ->make();
```

Testing
-------

[](#testing)

Guzzle on its own offers [testing facilities](http://docs.guzzlephp.org/en/stable/testing.html) but here we made it even easier. Just so you don't have to worry about setting up custom testing clients or dropping `if`s here and there:

```
$factory = new Factory(true, $logger);
$httpClient = $factory->enableLogging()->make();
$httpClient->get('https://api.github.com/users/GiangBeo');

$factory->getHistory($httpClient);
=>
[
 [
   "request" => GuzzleHttp\Psr7\Request {#7218},
   "response" => GuzzleHttp\Psr7\Response {#7225},
   "error" => null,
   "options" => [
     "synchronous" => true,
     "handler" => GuzzleHttp\HandlerStack {#7205},
     "allow_redirects" => [
       "max" => 5,
       "protocols" => [
         "http",
         "https",
       ],
       "strict" => false,
       "referer" => false,
       "track_redirects" => false,
     ],
     "http_errors" => true,
     "decode_content" => true,
     "verify" => true,
     "cookies" => false,
     "idn_conversion" => true,
   ],
 ],
 ...
```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

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

Every ~37 days

Recently: every ~45 days

Total

6

Last Release

1951d ago

PHP version history (2 changes)1.0.0PHP ^7.4

1.0.1PHP ^7.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/09f7d0bae763e995aa8b55c06da4a631819fc5e7acf10f1aa4a17e1ea8ab0fd8?d=identicon)[giangbeoit](/maintainers/giangbeoit)

---

Top Contributors

[![GiangBeo](https://avatars.githubusercontent.com/u/3804842?v=4)](https://github.com/GiangBeo "GiangBeo (6 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[shopify/shopify-api

Shopify API Library for PHP

4634.8M16](/packages/shopify-shopify-api)[akamai-open/edgegrid-client

Implements the Akamai {OPEN} EdgeGrid Authentication specified by https://developer.akamai.com/introduction/Client\_Auth.html

482.5M6](/packages/akamai-open-edgegrid-client)[api-platform/metadata

API Resource-oriented metadata attributes and factories

223.5M96](/packages/api-platform-metadata)[phpro/http-tools

HTTP tools for developing more consistent HTTP implementations.

28137.8k](/packages/phpro-http-tools)[mimmi20/browser-detector

Library to detect Browsers and Devices

48153.5k3](/packages/mimmi20-browser-detector)[discord-php/http

Handles HTTP requests to Discord servers

25318.7k8](/packages/discord-php-http)

PHPackages © 2026

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