diff --git a/lib/Cake/Network/CakeRequest.php b/lib/Cake/Network/CakeRequest.php index 672a6799a26..b0aa861052d 100644 --- a/lib/Cake/Network/CakeRequest.php +++ b/lib/Cake/Network/CakeRequest.php @@ -915,6 +915,17 @@ public function input($callback = null) { return $input; } +/** + * Modify data originally from `php://input`. Useful for altering json/xml data + * in middleware or DispatcherFilters before it gets to RequestHandlerComponent + * + * @param string $input A string to replace original parsed data from input() + * @return void + */ + public function setInput($input) { + $this->_input = $input; + } + /** * Allow only certain HTTP request methods. If the request method does not match * a 405 error will be shown and the required "Allow" response header will be set.