Repository navigation
MediaType
Viames Marino edited this page Nov 6, 2026
·
1 revision
Pair\Http\MediaType parses HTTP media types and negotiates representations according to RFC 9110.
-
parse(string $value, bool $range = false): array: returns[lowercaseType, parameters, qualityThousandths]; unquotes parameters, validates unique names and q syntax. When range=false, q is an ordinary media parameter. -
accepts(?string $accept, string $representation = 'application/json'): bool: match the representation's media parameters, apply the most specific matching range before its quality, and accept only a nonzero quality. An absent header permits the representation; an empty header accepts no media type. -
split(string $value, string $delimiter): array: quoted-aware HTTP list/parameter splitting.
Malformed headers throw InvalidArgumentException; applications translate this to an HTTP error before processing domain data. No application error code or JSON envelope is embedded in the framework parser.
Maintained by Viames Marino — VM Ingegneria · Professional enquiries
Home · Setup · Configuration
Build with Pair 4
- Generator
- Controllers and responses
- Read models
- ActiveRecord and queries
- Forms and validation
- PairUI.js, PairMotion.js and HTML fragments
APIs and authentication
- API guide and CRUD
- Middleware and rate limits
- Users, sessions, and ACL
- Passkeys and social login
- Native mobile setup
Integrate and operate
- Integrations
- Runtime extensions and adapter keys
- Cache and cache stores
- Logs and observability
- PWA and push
- Packages and distribution
- Upgrade to v4