Request Method
Every HTTP request has a method (i.e. GET or POST). You can obtain the current HTTP request method via the below request objects:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
/** * What is the request method? * @return string (e.g. GET, POST, PUT, DELETE) */ $app->req->getMethod(); /** * Is this a GET request? * @return bool */ $app->req->isGet(); /** * Is this a POST request? * @return bool */ $app->req->isPost(); /** * Is this a PUT request? * @return bool */ $app->req->isPut(); /** * Is this a DELETE request? * @return bool */ $app->req->isDelete(); /** * Is this a HEAD request? * @return bool */ $app->req->isHead(); /** * Is this a OPTIONS request? * @return bool */ $app->req->isOptions(); /** * Is this a PATCH request? * @return bool */ $app->req->isPatch(); /** * Get host * @return bool */ $app->req->getHost(); /** * Returns url based on protocol, route and prefix. */ $app->req->url_for($route,$prefix = null); /** * Returns GET variable if set */ $app->req->_get($caller); /** * Returns POST variable if set */ $app->req->_post($caller); |
Last Modified:
Liten Framework › Forums › Request