Skip to content

Easily add information to the response headers via service

License

Notifications You must be signed in to change notification settings

sbambach/apitk-header-bundle

 
 

Repository files navigation

apitk-header-bundle

Overview

This bundle provides useful features for a symfony based RESTful API.

Installation

Install the package via composer:

composer require check24/apitk-header-bundle

Usage

Header information

You can easily add information to the response headers by using the HeaderInformation service. These information will automatically be added to the response and prefixed with x-apitk-

public function index(HeaderInformation $headerInformation): array
{
    $users = $this->getUsers();
    
    $headerInformation->add('users-count', count($users));

    return $users;
}

will result in a response header x-apitk-users-count: 15.

Deprecations (apitk-deprecation-bundle)

You can mark actions as deprecated so developers can notice that they have to update their API call to a newer version or to use a whole other endpoint.

see CHECK24/apitk-deprecation-bundle

About

Easily add information to the response headers via service

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%