0

Is there a way to log the received POST request data before the data validation stage implemented via Restler?

Antoan Milkov
  • 2,152
  • 17
  • 30

2 Answers2

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