-
Notifications
You must be signed in to change notification settings - Fork 0
Request
John Aldrich Bernardo edited this page Jan 28, 2018
·
3 revisions
Check if request variable are set.
-
$requests:mixed- HTTP Request Method (defaultnull)
$home = new Route('/', function(Request $req, Response $res, array $args) {
if ($req->is('new-user')) {
$res->setCookie(['Hello'=>'World']);
}
return $res->set('Hello World');
});Check if provided HTTP request method is set.
-
$method:string- HTTP Method
$home = new Route('/', function(Request $req, Response $res, array $args) {
if ($req->isMethod('POST')) {
$res->setCookie(['Hello'=>'World']);
}
return $res->set('Hello World');
});Get specified or all HTTP requests.
-
$requests:mixed- HTTP Request Method (defaultnull)
$home = new Route('/', function(Request $req, Response $res, array $args) {
return $req->get(["name"]);
});Get HTTP Request method.
Get HTTP Request URI.
Get specified HTTP Request header.
Get HTTP Request headers.
The calf is open-sourced software licensed under the MIT license.