The icanboogie/http package provides a foundation to handle HTTP requests, with representations for requests, request files, responses, and headers.
The following example is an overview of request processing:
<?php namespace ICanBoogie\HTTP; // The request is usually created from the $_SERVER super global. $request = Request::from_server(); /* @var ResponderProvider $responder_provider */ // The Responder Provider matches a request with a Responder $responder = $responder_provider->responder_for_request($request); // The Responder responds to the request with a Response, it might also throw an exception. $response = $responder->respond($request); // The response is sent to the client. (new SimpleResponseSender())->send($response->finalize($request)); # or $response($request); // request is only necessary in file responses
composer require icanboogie/http
- Request: request creation, parameters, files, and context.
- Response: response status, streaming, redirects, and file delivery.
- Headers: header fields manipulation.
- Responders: responders and their decorators.
- Exceptions: HTTP-related exceptions.
The project is continuously tested by GitHub actions.
This project adheres to a Contributor Code of Conduct. By participating in this project and its community, you're expected to uphold this code.
See CONTRIBUTING for details.
icanboogie/http is released under the BSD-3-Clause.