Exemple #1
0
 /**
  * @return bool
  */
 public function isXmlHttpRequest()
 {
     return $this->header->has('X_REQUESTED_WITH') ? 'xmlhttprequest' === strtolower($this->header->get('X_REQUESTED_WITH')) : false;
 }
Exemple #2
0
 /**
  * Is the response a redirect of some form?
  *
  * @param string $location
  *
  * @return bool
  *
  * @api
  */
 public function isRedirect($location = null)
 {
     return in_array($this->statusCode, array(201, 301, 302, 303, 307, 308)) && (null === $location ?: $location == $this->header->get('Location'));
 }