budgetdumpster/slim-content-negotiation

Content Negotiation Middleware for Slim 3.0

Maintainers

Package info

github.com/BD-StrategicTech/slim-content-negotiation

pkg:composer/budgetdumpster/slim-content-negotiation

Statistics

Installs: 2 591

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

1.0.0 2017-12-13 17:39 UTC

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.