Skip to content

Commit

Permalink
Add setInput function to CakeRequest
Browse files Browse the repository at this point in the history
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 30, 2014
1 parent 6bacc5b commit 6bf0b22
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/Cake/Network/CakeRequest.php
Expand Up @@ -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.
Expand Down

0 comments on commit 6bf0b22

Please sign in to comment.