evolutionphp / http
HTTP Request and Response.
Installs: 12
Dependents: 2
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/evolutionphp/http
Requires
- php: >=8.2
- evolutionphp/instance: v1.0
- symfony/http-foundation: v7.2.3
README
HTTP Request and Response.
HTTP Request
$request = \EvolutionPHP\HTTP\HTTP::request(); echo $request->get('name'); //Like $_GET['name'] echo $request->ip_address(); //Client IP Address echo $request->method(); //return method 'get' or 'post' if($request->is_method('post')){ echo 'POST method.' }
HTTP Response
$response = \EvolutionPHP\HTTP\HTTP::response(); //Send response $response->send('Hello world!'); //Send JSON $response->json(['a' => 'b']); //Force download a file (write) $response->download()->write('My Text File','test.txt'); //Force download a file (path) $response->download()->file('/path/me.jpg', 'new_name.jpg');