objective-php/rest-action
Composer 安装命令:
composer require objective-php/rest-action
包简介
Rest(ful) aware PSR-15 Middleware library
README 文档
README
Rest(ful) aware PSR-15 Middleware library
Getting started
RestAction provide an easy way to build versioned API endpoints and support proactive content negotiation.
$action = new RestAction(); /* * Assume our RestAction has `application/xml` and `application/json` available * as media types, in order of highest-to-lowest preference for delivery */ $action->registerSerializer('application/*json', JsonSerializer::class); /* * Assume our RestAction has two Endpoints version available with * requests like `https://api.example/users` with `API-VERSION:1.0.0` or `API-VERSION:2.0.0` header * * Note that it support Semver matching, so the resource is also available with * requests like `https://api.example/users` with `API-VERSION:1` or `API-VERSION:2` header */ $action->registerEndpoint('1.0.0', UsersEndpointV1::class); $action->registerEndpoint('2.0.0', UsersEndpointV2::class);
统计信息
- 总下载量: 4.81k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0
- 更新时间: 2018-04-26