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)578.9k—6.4%14Apache-2.0PHPPHP ^7.2|^8.0CI passing

Since Sep 2Pushed 2mo 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 1mo ago

READMEChangelog (2)Dependencies (4)Versions (4)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

46

—

FairBetter than 93% of packages

Maintenance58

Moderate activity, may be stable

Popularity38

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 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

1117d 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://www.gravatar.com/avatar/790415b4bc1ae3fea0d743c069738cbdbfc4a4fd436eaeeb31ca10d8caf50ff4?d=identicon)[asispts](/maintainers/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.

34552.0k9](/packages/aura-accept)[friendsofsymfony/rest-bundle

This Bundle provides various tools to rapidly develop RESTful API's with Symfony

2.8k73.3M319](/packages/friendsofsymfony-rest-bundle)[ptlis/conneg

Tools for performing content negotiation.

364.9k1](/packages/ptlis-conneg)[react/http

Event-driven, streaming HTTP client and server implementation for ReactPHP

78026.4M414](/packages/react-http)[php-http/curl-client

PSR-18 and HTTPlug Async client with cURL

48347.0M384](/packages/php-http-curl-client)[smi2/phpclickhouse

PHP ClickHouse Client

84310.1M71](/packages/smi2-phpclickhouse)

PHPackages © 2026

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