FastForward HTTP Factory
fast-forward/http-factory
helps you bootstrap HTTP message factories quickly in Fast Forward applications.
It combines three pieces that beginners often need at the same time:
- a service provider that wires common HTTP services into the container
- the standard PSR-17 factory interfaces for requests, responses, streams, URIs, and uploaded files
- Fast Forward convenience factories for common response and payload-stream scenarios
The package is intentionally small. It does not replace a router, middleware dispatcher, or full HTTP kernel. Its job is to make the creation of PSR-7 and PSR-17 objects predictable and easy to reuse.
What You Get
Nyholm\Psr7\Factory\Psr17Factoryregistered once and reused through multiple PSR-17 aliasesNyholm\Psr7Server\ServerRequestCreatorandServerRequestInterface::classresolution from PHP globalsFastForward\Http\Message\Factory\ResponseFactoryfor HTML, JSON, text, redirect, and no-content responsesFastForward\Http\Message\Factory\StreamFactoryfor regular PSR-17 streams plus payload-aware JSON streams
Useful Links
Contents:
- Getting Started
- Usage
- Advanced Topics
- API Reference
- Links
-
FAQ
- What is the difference between the PSR response factory and the Fast Forward response factory?
- Do I need to use fast-forward/container?
- Which services are registered by the provider?
- Can I use the package without a PSR-11 container?
- Why does createResponseNoContent() always return 204?
- Why does createResponseRedirect() take a boolean instead of a numeric status?
- What concrete classes do the helper methods return?
- Are those returned objects still PSR-7 compatible?
- What happens if my JSON payload contains a resource?
- How do I access the current request?
- Should I keep ServerRequestInterface in a singleton service?
- How do I override the default implementations?
- Compatibility