PSR-7 规范的实现。


README

这是 PSR-7: HTTP 消息接口规范的一个实现。

既然已经有那么多现成的轮子,为什么还要重新造轮子呢?

因为我想这么做。




小技巧

除了实现 PSR-7,还有其他方法可以使事情变得更简单。

ServerRequest
::post($name, $default = null)
::get($name, $default = null)
::cookie($name, $default = null)
::server($name, $default = null)

从请求中快速检索数据的方法,类似于传统的全局变量:$_POST$_GET$_COOKIE$_SERVER

Response
::withAddedCookie(string $name, string $value, ?int $expires = null, string $path = '', string $domain = '', bool $secure = false, bool $httpOnly = false)

它的工作方式与 setcookie() 非常相似。




许可证

MIT