budgetdumpster / slim-content-negotiation
Content Negotiation Middleware for Slim 3.0
Package info
github.com/BD-StrategicTech/slim-content-negotiation
pkg:composer/budgetdumpster/slim-content-negotiation
1.0.0
2017-12-13 17:39 UTC
Requires
- php: >=5.5.0
- slim/slim: ^3.0
Requires (Dev)
- phpunit/phpunit: ^6.4
This package is not auto-updated.
Last update: 2026-03-09 13:59:46 UTC
README
Installation
composer require budgetdumpster/slim-content-negotiation:1.0.0
Usage
The Content Negotiation Middleware can be easily attached to a slim route like so:
<?php use BudgetDumpster\Middleware\ContentNegotiation; $app->get('/', function($request, $response, $args) { echo 'hello world'; })->add(new ContentNegotiationHalJson);
This will reject any requests that don't have content-types that match the provided content types.