Exemple #1
0
 /**
  * Set content type
  *
  * @param  string  $contentType the content type of the sent entity
  * @return boolean Returns TRUE on success or FALSE on failure.
  */
 public function setContentType($contentType)
 {
     return parent::addHeaders(array('Content-Type' => $contentType), false);
 }
Exemple #2
0
 /**
  * Sets the headers.
  *
  * @param array $headers associative array containing the new HTTP headers
  */
 public function setHeaders(array $headers)
 {
     parent::addHeaders($headers);
     $this->setServerGlobal('HTTP_HOST', (string) $this->getHeader('Host')[0]);
     $this->setServerGlobal('HTTP_ACCEPT', (string) $this->getHeader('Accept')[0]);
     $this->setServerGlobal('HTTP_CONNECTION', (string) $this->getHeader('Connection')[0]);
     $this->setServerGlobal('HTTP_USER_AGENT', (string) $this->getHeader('User-Agent')[0]);
     $this->setServerGlobal('HTTP_ACCEPT_ENCODING', (string) $this->getHeader('Accept-Encoding')[0]);
     $this->setServerGlobal('HTTP_ACCEPT_LANGUAGE', (string) $this->getHeader('Accept-Language')[0]);
     $this->setServerGlobal('HTTP_ACCEPT_CHARSET', (string) $this->getHeader('Accept-Charset')[0]);
     $this->setServerGlobal('HTTP_CACHE_CONTROL', (string) $this->getHeader('Cache-Control')[0]);
     $this->setServerGlobal('HTTP_COOKIE', (string) $this->getHeader('Cookie')[0]);
 }