# willdurand/Negotiation

Content Negotiation tools for PHP.

Repository: https://github.com/willdurand/Negotiation
Canonical: https://ross.abutalabs.com/products/negotiation
Homepage: https://williamdurand.fr/Negotiation/
Language: PHP
License: MIT
License Family: permissive
Topics: content-negotiation, negotiation, php
Last push: 2023-08-03T17:52:44+00:00

## Health v2 (maintenance only)
Score: 23/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 0, release rhythm 8, longevity 100
- inputs: {"age_days": 4975, "days_push": 1126, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1419, forks 64 (observed 2026-08-28T04:04:40.331340+00:00)

## What it is
A standalone, dependency-free PHP library implementing HTTP content negotiation per RFC 7231. It negotiates media types, languages, encodings, and charsets from Accept-style headers against a list of priorities.

## Use cases
- negotiate response format from Accept headers in a PHP API
- pick the best language based on Accept-Language header
- resolve charset and encoding preferences from HTTP requests
- implement RFC 7231 content negotiation in any PHP framework
- serve HTML or JSON depending on client preferences

## When to choose
- you need standards-compliant content negotiation in PHP
- you want a small library with zero dependencies
- you need media type, language, charset, and encoding negotiation in one package

## When to avoid
- your framework already provides built-in content negotiation
- you are not working in PHP
- you need full HTTP request/response handling rather than just header negotiation

## Facets
- artifact type: library
- maturity: maintenance
- function: http-server, middleware
- domain: web-development, backend, apis
- platform: php
- tags: content-negotiation, rfc7231, accept-header, http, composer

## Member repositories
- willdurand/Negotiation (main) score 23

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:40.331340+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T04:37:54.753401+00:00, confidence not recorded.
  - readme: https://github.com/willdurand/Negotiation (fetched 2026-08-28T04:04:40.331340+00:00, sha 4346df06d4b6)
  - homepage: https://williamdurand.fr/Negotiation/ (fetched 2026-08-29T11:50:19.338790+00:00, sha ea69a311aea5)
- Data as of 2026-08-30T08:39:29.467469+00:00.
