/** * @return bool */ public function isXmlHttpRequest() { return $this->header->has('X_REQUESTED_WITH') ? 'xmlhttprequest' === strtolower($this->header->get('X_REQUESTED_WITH')) : false; }
/** * 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')); }