HttpFoundation
HttpFoundation is a PHP library that provides an object-oriented representation of HTTP messages. It is the HTTP foundation component of the Symfony framework but is distributed independently as the symfony/http-foundation package, making it usable in non-Symfony projects as well. The component is widely adopted in PHP ecosystems, including Laravel and Drupal, for handling HTTP requests and responses in a framework-agnostic way.
The two central classes are Request and Response. The Request class encapsulates data from an HTTP request,
In addition to these, HttpFoundation provides supporting classes such as UploadedFile, Cookie, HeaderBag, ParameterBag, ServerBag, and
Usage and integration: In Symfony applications, HttpFoundation underpins the HTTP kernel and routing flow, translating a
History and compatibility: The component has evolved with Symfony since the early 2010s and remains a core,