budgetdumpster / slim-content-negotiation
Content Negotiation Middleware for Slim 3.0
Installs: 2 113
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: >=5.5.0
- slim/slim: ^3.0
Requires (Dev)
- phpunit/phpunit: ^6.4
This package is not auto-updated.
Last update: 2024-11-04 07:59:03 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.