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

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

jinexus-framework/jinexus-http
==============================

HTTP component from JiNexus Framework

v1.1.0(2w ago)001BSD-3-ClausePHPPHP ^8.5CI passing

Since Dec 10Pushed 2w ago1 watchersCompare

[ Source](https://github.com/jinexus-framework/jinexus-http)[ Packagist](https://packagist.org/packages/jinexus-framework/jinexus-http)[ Docs](https://github.com/jinexus-framework/jinexus-http)[ RSS](/packages/jinexus-framework-jinexus-http/feed)WikiDiscussions main Synced 2w ago

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

JiNexus Http
============

[](#jinexus-http)

`JiNexus Http` provides an object-oriented interface over PHP's HTTP request super-globals — `$_GET`, `$_POST`, `$_FILES`, `$_COOKIE`, and `$_SERVER` — along with convenient access to common request information such as whether the request is an Ajax call, whether it is served over HTTPS, and the base URL.

Request data is injected at construction and falls back to the super-globals when a key is omitted, so the component is easy to test and does not read global state once you pass it an explicit request array.

- Documentation:
- Issues:

Requirements
------------

[](#requirements)

- PHP `^8.5`

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

[](#installation)

Install via [Composer](https://getcomposer.org/):

```
composer require jinexus-framework/jinexus-http
```

Usage
-----

[](#usage)

### Creating a request

[](#creating-a-request)

```
use JiNexus\Http\Request\Request;
use JiNexus\Http\Request\Factory\RequestFactory;

// From the current super-globals...
$request = new Request();

// ...or via the factory.
$request = RequestFactory::build();

// ...or with explicit data (ideal for tests and CLI contexts).
$request = new Request([
    'cookie' => $_COOKIE,
    'file'   => $_FILES,
    'post'   => ['name' => 'jinexus'],
    'get'    => ['page' => '2'],   // note: the 'get' key populates the query bag
    'server' => $_SERVER,
]);
```

### The parameter bags

[](#the-parameter-bags)

Each of `cookie`, `file`, `post`, `query`, and `server` is a `Parameter` bag:

```
$request->query->get('page');          // '2'
$request->query->get('missing', 1);    // 1 (default when absent)
$request->post->has('name');           // true
$request->post->all();                 // ['name' => 'jinexus']
count($request->query);                // Countable
foreach ($request->server as $k => $v) { /* IteratorAggregate */ }

$request->query->add(['sort' => 'asc']); // merge/overwrite
$request->query->remove('page');         // delete
```

> Note the mapping: `$request->query` is built from the `get` key (and `$_GET`), not from a `query` key.

### Request helpers

[](#request-helpers)

```
$request->isAjax();    // true when the X-Requested-With header is "XMLHttpRequest"
$request->isSecure();  // true when the HTTPS server value is truthy
$request->baseUrl();   // e.g. "https://example.com/app"
```

### The HTTP container

[](#the-http-container)

```
use JiNexus\Http\Http\Http;
use JiNexus\Http\Http\Factory\HttpFactory;

$http = new Http($request);
$http->request;             // the RequestInterface it was constructed with

$http = HttpFactory::build(); // builds a Request internally and wraps it
```

### Error handling

[](#error-handling)

Package-level failures throw `JiNexus\Http\HttpException` (a subclass of `\Exception`). For example, an unsupported magic getter/setter resolved through `AbstractBase::__call`throws a `HttpException` with a `Not implemented: …` message.

Extending
---------

[](#extending)

`Request` and `Http` are deliberately empty subclasses of `AbstractRequest` and `AbstractHttp`. Keep them that way — the public accessors are implemented with PHP property hooks over backing fields, and declaring a real property would shadow them. For IDE autocompletion, prefer `@property` PHPDoc tags over real properties.

Testing
-------

[](#testing)

```
composer install
composer test            # or: ./vendor/bin/phpunit
composer test:coverage   # text coverage report
```

`phpunit.dist.xml` is the committed configuration. Use `XDEBUG_MODE=off` to silence the local Xdebug notice, and `--testdox` for readable output:

```
XDEBUG_MODE=off ./vendor/bin/phpunit --testdox
```

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

[](#contributing)

Please see [CONDUCT.md](CONDUCT.md) for the code of conduct. Contributions should include tests and a `CHANGELOG.md` entry. See [AGENTS.md](AGENTS.md) for detailed build, style, and workflow conventions.

License
-------

[](#license)

BSD-3-Clause. See [LICENSE.md](LICENSE.md).

###  Health Score

51

—

FairBetter than 95% of packages

Maintenance97

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity85

Battle-tested with a long release history

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

Recently: every ~697 days

Total

6

Last Release

16d ago

PHP version history (2 changes)1.0.0PHP ^5.6 || ^7.0

1.1.0.x-devPHP ^8.5

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6903966?v=4)[Jimvirle Calago](/maintainers/JiNexus)[@JiNexus](https://github.com/JiNexus)

---

Top Contributors

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

---

Tags

httpjinexus

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[guzzlehttp/psr7

PSR-7 message implementation that also provides common utility methods

7.9k1.1B4.4k](/packages/guzzlehttp-psr7)[psr/http-message

Common interface for HTTP messages

7.0k1.1B7.8k](/packages/psr-http-message)[psr/http-factory

PSR-17: Common interfaces for PSR-7 HTTP message factories

1.9k766.7M3.2k](/packages/psr-http-factory)[php-http/httplug

HTTPlug, the HTTP client abstraction for PHP

2.6k332.4M794](/packages/php-http-httplug)[psr/http-client

Common interface for HTTP clients

1.7k750.0M3.6k](/packages/psr-http-client)[symfony/http-client

Provides powerful methods to fetch HTTP resources synchronously or asynchronously

2.0k347.8M5.6k](/packages/symfony-http-client)

PHPackages © 2026

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