Skip to content
Permalink
Browse files

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.
  • Loading branch information...
derekperkins authored and markstory committed Jun 21, 2014
1 parent 6bacc5b commit 6bf0b22195da5dd0a0f9fb219f9dd530373502a3
Showing with 11 additions and 0 deletions.
  1. +11 −0 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.

0 comments on commit 6bf0b22

Please sign in to comment.
You can’t perform that action at this time.