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

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

asispts/http-accept
===================

PHP parser for HTTP Accept, Accept-Language, Accept-Encoding, and Content-Type headers.

v1.0.0(3y ago)5173.0k—3.9%1[1 PRs](https://github.com/asispts/http-accept/pulls)4Apache-2.0PHPPHP ^7.2|^8.0CI passing

Since Sep 2Pushed 1mo ago1 watchersCompare

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

READMEChangelog (2)Dependencies (4)Versions (5)Used By (4)

 http-accept
===========

[](#http-accept)

### » PHP parser for HTTP content negotiation headers «

[](#-php-parser-for-http-content-negotiation-headers--)

[![Build](https://github.com/asispts/http-accept/actions/workflows/ci.yml/badge.svg)](https://github.com/asispts/http-accept/actions/workflows/ci.yml)[![License](https://camo.githubusercontent.com/3bcf87f57b31d9ae5a7f3fd9a6daf367880bd009a927ea1553678e54588785a4/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f617369737074732f687474702d616363657074)](./LICENSE)[![PHP Version](https://camo.githubusercontent.com/b2e1249b4bbd9d6ead73e0c93b3ce836ec1e6a5acd5fb437eff6d0afbd51a85a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f617369737074732f687474702d6163636570742f706870)](https://packagist.org/packages/asispts/http-accept)[![Stable Version](https://camo.githubusercontent.com/360c7c722b602eb77e73db589aea6116e4790a04f90e6ebd2fd1c18c4d2218b5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f617369737074732f687474702d6163636570743f6c6162656c3d737461626c65)](https://packagist.org/packages/asispts/http-accept)[![Downloads](https://camo.githubusercontent.com/6278b2bf801be66372c301b3479c4f5c0659612b965f3c3f85aec7ea4855647b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f617369737074732f687474702d616363657074)](https://packagist.org/packages/asispts/http-accept)

`http-accept` is a PHP library for parsing HTTP headers used in content negotiation. It supports the following headers:

- `Accept`
- `Accept-Language`
- `Accept-Encoding`
- `Content-Type`

Parser classes are provided for each header, making it straightforward to extract information from incoming requests.

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

[](#installation)

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

```
composer require asispts/http-accept
```

Usage
-----

[](#usage)

Use the corresponding parser class for each header.

### Parse `Content-Type`

[](#parse-content-type)

```
$contentType = (new ContentTypeParser())->parse($source);
```

### Parse HTTP `Accept`

[](#parse-http-accept)

```
$types = (new AcceptParser())->parse($source);
```

### Parse `Accept-Language`

[](#parse-accept-language)

```
$languages = (new AcceptLanguageParser())->parse($source);
```

### Parse `Accept-Encoding`

[](#parse-accept-encoding)

```
$encodings = (new AcceptEncodingParser())->parse($source);
```

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

[](#contributing)

Contributions are welcome—whether bug reports, feature requests, or pull requests. For major changes, please open an issue first to discuss your ideas.

License
-------

[](#license)

Licensed under the [Apache-2.0 License](https://opensource.org/licenses/Apache-2.0). See the [LICENSE](./LICENSE) file for details.

###  Health Score

47

—

FairBetter than 93% of packages

Maintenance59

Moderate activity, may be stable

Popularity40

Moderate usage in the ecosystem

Community18

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 65% 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 ~602 days

Total

2

Last Release

1208d ago

Major Versions

v0.1 → v1.0.02023-04-28

PHP version history (2 changes)v0.1PHP ^7.1|^8.0

v1.0.0PHP ^7.2|^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/79239132?v=4)[Asis Pattisahusiwa](/maintainers/asispts)[@asispts](https://github.com/asispts)

---

Top Contributors

[![asispts](https://avatars.githubusercontent.com/u/79239132?v=4)](https://github.com/asispts "asispts (52 commits)")[![pattisahusiwa](https://avatars.githubusercontent.com/u/11484016?v=4)](https://github.com/pattisahusiwa "pattisahusiwa (22 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (3 commits)")[![tobyzerner](https://avatars.githubusercontent.com/u/128862?v=4)](https://github.com/tobyzerner "tobyzerner (3 commits)")

---

Tags

acceptaccept-encodingaccept-languagecontent-typehttp-header-parserhttp-headersacceptaccept-languagecontent-typeaccept-encodinghttp-headershttp-header-parser

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[aura/accept

Provides content-negotiation tools using Accept\* headers.

34564.7k9](/packages/aura-accept)[ptlis/conneg

Tools for performing content negotiation.

355.5k1](/packages/ptlis-conneg)[php-http/cache-plugin

PSR-6 Cache plugin for HTTPlug

25026.8M85](/packages/php-http-cache-plugin)[bitworking/mimeparse

Basic functions for handling mime-types.

41234.8k1](/packages/bitworking-mimeparse)[httpsoft/http-message

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

85997.3k131](/packages/httpsoft-http-message)[bakame/http-structured-fields

A PHP library that parses, validates and serializes HTTP structured fields according to RFC9561 and RFC8941

4510.0k8](/packages/bakame-http-structured-fields)

PHPackages © 2026

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