diff --git a/classes/Kohana/Request.php b/classes/Kohana/Request.php index e5ee71e5d..b7a40f6af 100644 --- a/classes/Kohana/Request.php +++ b/classes/Kohana/Request.php @@ -1328,4 +1328,44 @@ public function post($key = NULL, $value = NULL) return $this; } + /** + * Check to see if the current request is a POST request. + * + * @return bool Whether the request is a POST request or not. + */ + public function is_post() + { + return (HTTP_Request::POST === $this->_method); + } + + /** + * Check to see if the current request is a GET request. + * + * @return bool Whether the request is a GET request or not. + */ + public function is_get() + { + return (HTTP_Request::GET === $this->_method); + } + + /** + * Check to see if the current request is a PUT request. + * + * @return bool Whether the request is a PUT request or not. + */ + public function is_put() + { + return (HTTP_Request::PUT === $this->_method); + } + + /** + * Check to see if the current request is a DELETE request. + * + * @return bool Whether the request is a DELETE request or not. + */ + public function is_delete() + { + return (HTTP_Request::DELETE === $this->_method); + } + } // End Request