Add setInput function to CakeRequest

Modify data originally from `php://input`. Useful for altering json/xml
data in middleware or DispatcherFilters before it gets to
RequestHandlerComponent or other controllers.
This commit is contained in:
Derek Perkins 2014-06-21 08:31:32 -06:00 committed by mark_story
parent 6bacc5bb46
commit 6bf0b22195

View file

@ -915,6 +915,17 @@ class CakeRequest implements ArrayAccess {
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.