drewlabs/psr7
最新稳定版本:v0.2.5
Composer 安装命令:
composer require drewlabs/psr7
包简介
Psr7 implementations library
README 文档
README
This package provides implementations for Psr7 request, response and URi interfaces.
Installation
Use composer package manager [https://getcomposer.org/download/].
composer require drewlabs/psr7
Usage
- Creating Psr7 class
drewlabs/psr7 package provides a Drewlabs\Psr7\Request class for creating a psr7 request:
use Drewlabs\Psr7\Request; // Instantiate the psr7 class $request = new Request(); // Overriding the request method $request = $request->withMethod('POST'); // Overriding request headers $request = $request->withHeaders([ // ... ]);
- Creating Psr7 response interface
drewlabs/psr7 package provides a Drewlabs\Psr7\Response class for creating a psr7 response:
use Drewlabs\Psr7\Request; // Instantiate the psr7 class $response = new Response(); // Instantiate response with parameters $response = new Response('', [/* Response headers */]); // Overriding the response method $response = $response->withStatusCode(404); // Overriding response headers $response = $response->withHeaders([ // ... ]);
- Creating Psr7 URI instance
drewlabs/psr7 package provides a Drewlabs\Psr7\Uri class for creating a psr7 uri instances:
$uri = Uri::new(/* URI string | or Null */);
统计信息
- 总下载量: 559
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 3
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-11-20