Is there a way to log the received POST request data before the data validation stage implemented via Restler?
Asked
Active
Viewed 169 times
2 Answers
2
Use the onValidate event, it fires just before validation starts
//in your index.php after $r = new Restler()
$r->onValidate(function() use ($r){
Logger::log($r->getRequestData());
}

Arul Kumaran
- 983
- 7
- 23
0
Copy them to a variable, and validate values inside the variable:'
$my_post = $_POST;
//consider we want to validate some query-parameter called q
if(isset($my_post['q']) && ! empty($my_post['p'])) {
//do something
}

Ulrich Horus
- 352
- 3
- 9
-
This actually will not work since the Restler Validator will throw exception before your function is called. – Antoan Milkov Nov 15 '13 at 04:32