Download the PHP package boubacamara/ganega-http without Composer
On this page you can find all versions of the php package boubacamara/ganega-http. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download boubacamara/ganega-http
More information about boubacamara/ganega-http
Files in boubacamara/ganega-http
Package ganega-http
Short Description Provides simple and intuitive classes for handling HTTP requests and responses in PHP applications. The Request class encapsulates HTTP request data, making it easy to manage and access parameters, body, session, cookies, and server information. The Response class simplifies the creation and management of HTTP responses, allowing you to set content, status codes, and headers effortlessly.
License MIT
Informations about the package ganega-http
Ganega\Http
The Request
and Response
classes provide simple and intuitive interfaces for handling HTTP requests and responses in your PHP application. They encapsulate request data and HTTP responses, making their manipulation and management easier.
Purpose
The Request
and Response
classes are designed to simplify interaction with HTTP request and response data. They offer methods to check and retrieve request parameters, request body data, sessions, cookies, and server information, as well as to configure and send HTTP responses. This abstraction allows you to manipulate HTTP requests and responses cleanly and efficiently without directly accessing global variables like $_GET
, $_POST
, $_SESSION
, $_COOKIE
, $_SERVER
, and $_FILES
.
Ease of Use
The Request
and Response
classes provide a clear and concise interface with well-defined methods for common HTTP request and response operations. Using these classes helps reduce repetitive code and makes the code more readable and maintainable.
Installation
To use these classes in your project, simply include them in your PSR-4 autoloader or directly import them into your PHP file.
Usage Examples
Request Class
Create a Request
instance from global variables
Check if the request has a body
Get the request body
Check and retrieve a request parameter
Manipulate sessions
Manipulate cookies
Retrieve URL and server information
Parse the request body
Response Class
Create a Response
instance
Set the response content
Add content to the existing response
Set an HTTP header
Set the HTTP status code
Send the response
All versions of ganega-http with dependencies
ext-json Version *