PHPackages                             oasys/negotiator - 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. oasys/negotiator

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

oasys/negotiator
================

Strict RFC-compliant HTTP content negotiator with extended language filtering support

v1.0.0(3mo ago)01MITPHPPHP ^8.2CI passing

Since Mar 16Pushed 3mo agoCompare

[ Source](https://github.com/kweensey/oasys-negotiator)[ Packagist](https://packagist.org/packages/oasys/negotiator)[ RSS](/packages/oasys-negotiator/feed)WikiDiscussions main Synced 2w ago

READMEChangelogDependencies (2)Versions (2)Used By (0)

Oasys Negotiator
================

[](#oasys-negotiator)

[![Tests](https://github.com/kweensey/oasys-negotiator/actions/workflows/tests.yml/badge.svg)](https://github.com/kweensey/oasys-negotiator/actions/workflows/tests.yml)[![Latest Stable Version](https://camo.githubusercontent.com/e7ec2d3b72b2a8ae4cb4ac6a92712e71b6630ce726531f3a513e2b3c551e33b2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6f617379732f6e65676f746961746f72)](https://packagist.org/packages/oasys/negotiator)[![PHP Version Require](https://camo.githubusercontent.com/7bfb3ede758e687270df759615c08d1415d1ce4442784dd1d8de7e132061a4a2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6f617379732f6e65676f746961746f72)](https://packagist.org/packages/oasys/negotiator)[![License](https://camo.githubusercontent.com/2f7c69bd7b5b3aede32fde702386f100cf981a5b2ec238c35970050c000a5c6a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6f617379732f6e65676f746961746f72)](https://packagist.org/packages/oasys/negotiator)

Strict RFC-compliant HTTP content negotiator.

Implements HTTP negotiation semantics defined in RFC 9110 and language matching defined in RFC 4647.

- Negotiation for `Accept`, `Accept-Language`, `Accept-Encoding`, and `Accept-Charset` headers
- Deterministic tie-breaking and stable selection
- Basic and extended language filtering
- Strict token and quoted-string parsing with correct handling of quoted parameters and escaped characters
- Quality (`q`) weighting and wildcard handling
- Media range specificity precedence (`text/plain;charset=utf-8` &gt; `text/plain` &gt; `text/*` &gt; `*/*`)

---

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

[](#installation)

```
composer require oasys/negotiator
```

---

Quick start
-----------

[](#quick-start)

```
