-
Notifications
You must be signed in to change notification settings - Fork 1
PSR 15: RequestHandler Example
Terry L edited this page Jun 20, 2020
·
5 revisions
Namespace
Shieldon\Psr15\RequestHandler-
param
RequestHandlerInterfacefallbackHandler*The request handler.
Example:
$finalHandler = new FinalHandler();
$app = new RequestHandler($finalHandler);
$app->add(new ApiMiddleware());
$app->add(new StringMiddleware());
$response = $app->handle(ServerRequestFactory::fromGlobal());-
param
MiddlewareInterfacemiddleware*The middleware. -
return
void
Example:
$app->add(new ApiMiddleware());-
param
ServerRequestInterfacerequest*The server request. -
return
ResponseInterface
Example:
$response = $app->handle(ServerRequestFactory::fromGlobal());composer require shieldon/psr-httpShieldon PSR HTTP implementation written by Terry L. from Taiwan.
