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

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

hugphp/http
===========

A delightful HTTP client with a human-readable API.

v1.0.0(1y ago)04MITPHPPHP ^8.3.0CI passing

Since Feb 27Pushed 1y agoCompare

[ Source](https://github.com/hugphp/http)[ Packagist](https://packagist.org/packages/hugphp/http)[ Fund](https://www.paypal.com/paypalme/enunomaduro)[ GitHub Sponsors](https://github.com/nunomaduro)[ RSS](/packages/hugphp-http/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (8)Versions (2)Used By (0)

 [![hugphp/http](https://raw.githubusercontent.com/hugphp/http/main/docs/logo.png)](https://raw.githubusercontent.com/hugphp/http/main/docs/logo.png)

 [![GitHub Workflow Status (main)](https://github.com/hugphp/http/actions/workflows/tests.yml/badge.svg)](https://github.com/hugphp/http/actions) [![Total Downloads](https://camo.githubusercontent.com/ef75eac8fae424ef9a06dfded74d9b98ef00b96307965bcbbc8bab59a8ee0034/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6875677068702f68747470)](https://packagist.org/packages/hugphp/http) [![Latest Version](https://camo.githubusercontent.com/a314a850ee7951d39df369068f989ebe9f0d14981d25c21c6b65c43136e8a1b5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6875677068702f68747470)](https://packagist.org/packages/hugphp/http) [![License](https://camo.githubusercontent.com/e172787ed2c09a578232969f1bbcd379e5e945db06944f594d078458160829f4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6875677068702f68747470)](https://packagist.org/packages/hugphp/http)

---

HugPHP HTTP Client
==================

[](#hugphp-http-client)

A **delightful HTTP client** for PHP with a human-readable API, designed to make HTTP requests simple, lovable, and powerful.

> **Requires [PHP 8.3+](https://php.net/releases/)** and `ext-curl`

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

[](#installation)

Add HugPHP HTTP to your project using [Composer](https://getcomposer.org):

```
composer require hugphp/http
```

Features
--------

[](#features)

- Fluent, chainable API for intuitive request building.
- Built-in JSON support for easy data sending and parsing.
- Optional SSL verification toggle for flexibility.
- Lightweight and dependency-free (uses native cURL).

1. Example Usage
----------------

[](#1-example-usage)

```
use HugPHP\Http\Client;

$client = new Client();

// Simple GET request (SSL verification enabled by default)
$response = $client->to('https://api.example.com/data')->get();
echo $response->body();

// POST with JSON, disabling SSL verification
$response = $client->to('https://api.example.com/post')
                   ->withHeader('Authorization', 'Bearer token')
                   ->sendJson(['name' => 'HugPHP'])
                   ->withOutSSLCertificate() // Disables SSL verification
                   ->post();
print_r($response->json());

// Fetch JSON directly
$data = $client->to('https://api.example.com/users/1')
               ->withOutSSLCertificate()
               ->get()
               ->json();
echo $data['name'];
```

2. Example Usage
----------------

[](#2-example-usage)

```
use HugPHP\Http\Client;

$client = new Client();

// GET with rate limiting
$client->to('https://api.example.com/data')
       ->withRateLimit(5, 'minute')
       ->get();

// POST with JSON and debugging
$client->to('https://api.example.com/post')
       ->withHeader('Authorization', 'Bearer token')
       ->sendJson(['name' => 'HugPHP'])
       ->debug()
       ->post();

// Validate and transform response
class User {
    public int $id;
    public string $name;
}
$user = $client->to('https://api.example.com/user')
               ->withOutSSLCertificate()
               ->validateSchema('user-schema.json', User::class);
echo $user->name;

// Mock for testing
$client->mock('https://example.com', ['status' => 200, 'body' => '{"fake": true}']);
$data = $client->to('https://example.com')->get()->json();
```

Development
-----------

[](#development)

🧹 Keep a modern codebase with **Pint**:

```
composer lint
```

✅ Run refactors using **Rector**

```
composer refacto
```

⚗️ Run static analysis using **PHPStan**:

```
composer test:types
```

✅ Run unit tests using **PEST**

```
composer test:unit
```

🚀 Run the entire test suite:

```
composer test
```

**HugPHP HTTP** was created by **[Micheal Ataklt](https://www.linkedin.com/in/matakltm-code)** under the **[MIT license](https://opensource.org/licenses/MIT)**.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance43

Moderate activity, may be stable

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity52

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

446d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/29d95e37a7cc54ad24fd72a4452f07dbe16acd7dfdece66e60459c973c45aa2a?d=identicon)[matakltm-code](/maintainers/matakltm-code)

---

Top Contributors

[![matakltm-code](https://avatars.githubusercontent.com/u/65981238?v=4)](https://github.com/matakltm-code "matakltm-code (9 commits)")

---

Tags

httpphpclienthugphp

###  Code Quality

TestsPest

Static AnalysisPHPStan, Rector

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[smi2/phpclickhouse

PHP ClickHouse Client

84310.1M71](/packages/smi2-phpclickhouse)

PHPackages © 2026

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