Skip to content

EvolutionPHP/http

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

http

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');

About

HTTP Request and Response.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages