Our great sponsors
-
http-message
The purpose of this PSR is to provide a set of common interfaces for HTTP messages as described in RFC 7230 and RFC 7231
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
One of the most common places you'll find middleware being used is within a framework that transforms a Request object into a Response object. PSR-15: HTTP Server Request Handlers in the PHP Standard Recommendation (PSR), is a recommendation on how a (PSR-7) Request object should be handled and turned into a Response object. This recommendation also contains the Psr\Http\Server\MiddlewareInterface. This interface favors the use of a process method on a middleware class, but the principle is the same. It receives an input (the Request object), modifies it, and passes it along to RequestHandler which will trigger the next middleware or final action.
Related posts
- FrankenPHP, an app server for PHP written in Go: worker mode, Early Hints support, real-time capabilities, automatic HTTPS & HTTP/3
- Legacy "Routing" with PHP 8.1
- PER Coding Style 1.0.0
- The sad state of PSR-7
- [OOP] Best practice in structuring class hierarchies. I would like an API request to contact 2 different platforms, each in (the same) 2 different ways (GET and POST). How should I structure my class hierarchy? Thanks :)