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());
}
Вопрос
Is there a way to log the received POST request data before the data validation stage implemented via Restler?
Решение
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());
}
Другие советы
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
}