HTTP

Routing

Routing allows you to create custom pages in Saturn.

use Saturn\HTTPManager\Router;
$Router = new Router();

//GET
$Router->GET('/myroute', '/Plugins/MyPlugin/MyFile.php');
// POST
$Router->POST('/myformpost', '/Plugins/MyPlugin/MyFile.php');

Response

Response allows you to quickly and easily send HTTP responses in PHP. The functions modify the headers sent by PHP then terminate the script.

use Saturn\HTTPManager\Response;
$Response = new Response();

// Send HTTP 500
$Response->HTTP500();

// Send HTTP 405
$Response->HTTP405();

// Send HTTP 404
$Response->HTTP404();

// Send HTTP 403
$Response->HTTP403();

Last updated