Requests

Requests are HTTP messages and/or data recevied by web server from different sources.

In the Quantum framework requets are handled with Request class, which extends the base HttpRequest class. Requests can come to server in different methods (GET, POST, PUT, DELETE) so they should be handled appropriately. The Request class has all the necessary methods to handle each request correctly.

  • Request::get($key [, $default]) - Returns a parameter by given key, sent by GET method
  • Request::post($key [, $default]) - Returns a parameter by given key, sent by POST method
  • Request::any($key) - Returns a parameter by given key, sent by any of methods
  • Request::all() - Returns all the request parameters as array
  • Request::getHeaders() - Returns all the headers as array
  • Request::getCSRFToken() - Gets the Сross Site Request Forgery Token
  • Request::getAllSegments() - Gets all the segments of current URI
  • Request::getSegment($number) - Gets the nth segment of current URI
  • Request::getCurrentRoute() - Returns the current route
  • Request::hasFile($key) - Checks to see if request contains file
  • Request::isAjax() - Checks to see if request was ajax request
<< Prev Next >>