Skip to content

Repository files navigation

Fast Forward HTTP

PHP VersionComposer PackageTestsCoverageDocsLicenseGitHub Sponsors

PSR-7PSR-11PSR-17PSR-18

Fast Forward HTTP is the aggregate HTTP package of the Fast Forward ecosystem.

It is designed for developers who want a practical starting point for HTTP work without wiring each piece manually. Install one package, register one provider, and you get the default Fast Forward HTTP stack in your container.

What You Get

  • PSR-17 factories for requests, responses, server requests, streams, uploaded files, and URIs
  • A PSR-18 HTTP client backed by Symfony HttpClient
  • A ServerRequestInterface created from PHP globals
  • Fast Forward convenience factories for JSON, HTML, text, redirect, empty responses, and payload streams
  • One aggregate HttpServiceProvider that wires the stack together

Installation

composer require fast-forward/http

Quickstart

<?phpdeclare(strict_types=1);
useFastForward\Http\Message\Factory\ResponseFactoryInterface;
useFastForward\Http\ServiceProvider\HttpServiceProvider;
usefunctionFastForward\Container\container;
$container = container(newHttpServiceProvider());
$responseFactory = $container->get(ResponseFactoryInterface::class);
$response = $responseFactory->createResponseFromPayload([
'message' => 'Hello, Fast Forward HTTP!',
'ok' => true,
]);
echo$response->getHeaderLine('Content-Type');
// application/json; charset=utf-8

Main Services

IdentifierDefault concrete servicePurpose
Psr\Http\Message\RequestFactoryInterfaceNyholm\Psr7\Factory\Psr17FactoryCreate outbound requests
Psr\Http\Message\ResponseFactoryInterfaceNyholm\Psr7\Factory\Psr17FactoryCreate plain PSR-17 responses
FastForward\Http\Message\Factory\ResponseFactoryInterfaceFastForward\Http\Message\Factory\ResponseFactoryCreate JSON, HTML, text, redirect, and empty responses
FastForward\Http\Message\Factory\StreamFactoryInterfaceFastForward\Http\Message\Factory\StreamFactoryCreate payload-aware JSON streams
Psr\Http\Message\ServerRequestInterfaceServerRequestCreator::fromGlobals() resultAccess the current incoming request
Psr\Http\Client\ClientInterfaceSymfony\Component\HttpClient\Psr18ClientSend outbound HTTP requests

Documentation

See the documentation sources in docs/ for:

  • installation and quickstart
  • retrieving services from the container
  • responses, streams, and server requests
  • advanced customization and aliasing
  • aggregated services and compatibility notes

Related Packages

License

Fast Forward HTTP is licensed under the MIT license.

About

This package serves as an aggregate metapackage, bundling all http components of the Fast Forward ecosystem for easier installation and management.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages