Future of laminas-http

laminas-http is largely superseded by PSR-7: HTTP message interfaces and PSR-18: HTTP Client
In its current state it will go into deprecation and maintenance only mode.

I think there are usable parts that could be salvaged there, so here is what I think could be done here:

  • Re-implement Request and Response as mutable psr message builders.
  • Minimally change interface to align closer with psr requests. Eg accept psr streams as a body and use psr uri as a laminas-uri replacement.
  • Focus on improving rich headers handling. Headers container should be able to initialize directly from and to apply headers directly to psr message
  • Keep stdlib interfaces.
  • transparently incorporate parts of laminas-psr-bridge in a more sensible and efficient way by tracking changes within builders and producing/caching new psr objects only if change was made.
  • Drop Client or potentially extract into laminas-http-client if there is a value for reimplementing it under psr-18 interface

Such change might prove to be a valuable stepping stone for migrating from current laminas-http based flows to psr.

Thoughts?

Hi Xerkus, imho less code written, less code to maintain.

Current laminas-http repo is mix of PSR-7 and PSR-18. I would drop it completely.
PSR-7 is implemented in Diactoros.
PSR-18 in Laminas is not implemented. Laminas framework (Zend framework) nor Mezzio (Expressive) do not need HTTP client. I see no sense to create another PSR-18 HTTP client.

Personally I would like to see refactored http-router with PSR-7. As I know you created PR on zend router a year or two ago which was not finished/merged :frowning:

This is something that is really handy. Refactoring them to immutable objects would be great. Maybe moving them to diactoros?