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

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

francerz/http-utils
===================

PHP HTTP utils compatible with PSR-7, PSR-17

v0.2.66(1y ago)13.1k7MITPHP

Since Oct 18Pushed 1y ago1 watchersCompare

[ Source](https://github.com/francerz/php-http-utils)[ Packagist](https://packagist.org/packages/francerz/http-utils)[ RSS](/packages/francerz-http-utils/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (10)Dependencies (3)Versions (69)Used By (7)

PHP Http Utils
==============

[](#php-http-utils)

PHP HTTP utils library that supports PSR-7 and PSR-17 with basic helpers and common operations.

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

[](#installation)

Using composer.

```
composer require francerz/http-utils
```

Featured functionality
----------------------

[](#featured-functionality)

### HttpFactoryManager class

[](#httpfactorymanager-class)

Preserve per instance, reference of PSR-17 Factories (psr/http-factory). Uses set and get methods to manage existing factory instances.

#### Individual setter methods

[](#individual-setter-methods)

- `setRequestFactory(RequestFactoryInterface $requestFactory)`
- `setResponseFactory(ResponseFactoryInterface $responseFactory)`
- `setServerRequestFactory(ServerRequestFactoryInterface $serverRequestFactory)`
- `setStreamFactory(StreamFactoryInterface $streamFactory)`
- `setUploadedFileFactory(UploadedFileFactoryInterface $uploadedFileFactory)`
- `setUriFactory(UriFactoryInterface $uriFactory)`

#### Getter methods

[](#getter-methods)

Getter Methods will throw a `LogicException` if not factory has been set previously.

- `getRequestFactory() : RequestFactoryInterface`
- `getResponseFactory() : ResponseFactoryInterface`
- `getServerRequestFactory() : ServerRequestFactoryInterface`
- `getStreamFactory() : StreamFactoryInterface`
- `getUploadedFileFactory() : UploadedFileFactoryInterface`
- `getUriFactory() : UriFactoryInterface`

#### Automatic setter method

[](#automatic-setter-method)

The method `setMatchingFactories($factoryObject)` receives an object and checks implementation of each Factory Interface. All matching interfaces will be set.

This method is included on the constructor to quick factory setting.

### UriHelper class

[](#urihelper-class)

Provides methods for common manipulation to `UriInterface` objects.

#### Creating uri of current request

[](#creating-uri-of-current-request)

- `getCurrent(UriFactoryInterface $uriFactory) : UriInterface`

#### Path part manipulation

[](#path-part-manipulation)

- `appendPath(UriInterface $uri, string $postpath) : UriInterface`
- `prependPath(UriInterface $uri, string $prepath) : UriInterface`

#### Query part manipulation

[](#query-part-manipulation)

- `withQueryParams(UriInterface $uri, string $key, $value) : UriInterface`
- `withQueryParams(UriInterface $uri, array $params, $replace = true) : UriInterface`
- `withoutQueryParam(UriInterface $uri, string $key, &$value = null) : UriInterface`
- `getQueryParams(UriInterface $uri) : array`
- `getQueryParam(UriInterface $uri, string $key) : ?string`

#### Fragment part manipulation

[](#fragment-part-manipulation)

- `withFragmentParam(UriInterface $uri, string $key, $value) : UriInterface`
- `withFragmentParams(UriInterface $uri, array $params, $replace = true) : UriInterface`
- `withoutFragmentParam(UriInterface $uri, string $key, &$value = null) : UriInterface`
- `getFragmentParams(UriInterface $uri) : array`
- `getFragmentParam(UriInterface $uri, string $key) : ?string`

### MessageHelper class

[](#messagehelper-class)

Provides methods for common manipulation to `MessageInterface` objects.

#### Helper setup

[](#helper-setup)

- `setHttpFactoryManager(HttpFactoryManager $factories)`
- `setAuthenticationSchemes(array $authenticationSchemeClasses)`

#### Creating a request object from server parameters

[](#creating-a-request-object-from-server-parameters)

- `getCurrentRequest() : RequestInterface`

#### Handling message headers

[](#handling-message-headers)

- `getAuthorizationHeader(MessageInterface $message) : ?AbstractAuthorizationHeader`

#### Parsing body message content based on Content-Type header

[](#parsing-body-message-content-based-on-content-type-header)

- `getContent(MessageInterface $message)`
- `withContent(MessageInterface $message, string $mediaType, $content) : MessageInterface`

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance44

Moderate activity, may be stable

Popularity21

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity59

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

Recently: every ~3 days

Total

68

Last Release

440d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/630263d156ec44e1d55c3d237fe08354442d0cbe7b257032997d0a649baf1854?d=identicon)[francerz](/maintainers/francerz)

---

Top Contributors

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

---

Tags

factoryhttpmanipulationphpphp-httppsrpsr17-http-factorypsr7-httphttppsr-7http-messagepsr-17http-factory

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[guzzlehttp/psr7

PSR-7 message implementation that also provides common utility methods

7.9k1.1B3.7k](/packages/guzzlehttp-psr7)[symfony/psr-http-message-bridge

PSR HTTP message bridge

1.3k312.3M929](/packages/symfony-psr-http-message-bridge)[laminas/laminas-stratigility

PSR-7 middleware foundation for building and dispatching middleware pipelines

577.0M95](/packages/laminas-laminas-stratigility)[mezzio/mezzio

PSR-15 Middleware Microframework

3903.8M120](/packages/mezzio-mezzio)[httpsoft/http-message

Strict and fast implementation of PSR-7 and PSR-17

87930.4k113](/packages/httpsoft-http-message)[phpro/http-tools

HTTP tools for developing more consistent HTTP implementations.

28146.3k](/packages/phpro-http-tools)

PHPackages © 2026

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