check24/apitk-header-bundle

此包为RESTful API提供了有用的API助手

安装数: 4,333

依赖项: 2

建议者: 0

安全: 0

星标: 1

关注者: 4

分支: 4

类型:symfony-bundle

4.0.0 2022-01-19 12:58 UTC

This package is auto-updated.

Last update: 2024-09-05 01:42:02 UTC


README

概述

此包为基于symfony的RESTful API提供了有用的功能。

安装

使用composer安装此包

composer require check24/apitk-header-bundle

用法

头部信息

您可以通过使用HeaderInformation服务轻松地向响应头添加信息。这些信息将自动添加到响应中,并带有前缀x-apitk-

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

    $headerInformation->add('users-count', (string) count($users));

    return $users;
}

将生成响应头x-apitk-users-count: 15

弃用(apitk-deprecation-bundle)

您可以标记操作为弃用,这样开发者就会注意到他们需要更新API调用到新版本或使用全新的端点。

详见 CHECK24/apitk-deprecation-bundle