budgetdumpster/slim-content-negotiation

Content Negotiation Middleware for Slim 3.0

Installs: 2 384

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

pkg:composer/budgetdumpster/slim-content-negotiation

1.0.0 2017-12-13 17:39 UTC

This package is not auto-updated.

Last update: 2025-10-06 12:07:53 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.