src/Generics/Client/HttpHeadersTrait.php
private function adjustHeaders($requestType)
    {
        if (! array_key_exists('Accept', $this->headers) && $requestType != 'HEAD') {
            $this->setHeader('Accept', 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8');
        }
        
        if (! array_key_exists('Accept-Language', $this->headers) && $requestType != 'HEAD') {
            $this->setHeader('Accept-Language', 'en-US;q=0.7,en;q=0.3');
        }
        
        if (! array_key_exists('User-Agent', $this->headers) && $requestType != 'HEAD') {
            $this->setHeader('User-Agent', 'phpGenerics 1.0');
        }
        
        if (! array_key_exists('Connection', $this->headers) || strlen($this->headers['Connection']) == 0) {
            $this->adjustConnectionHeader($requestType);
        }
        
        if (! array_key_exists('Accept-Encoding', $this->headers)) {
            if (function_exists('gzinflate')) {
                $encoding = 'gzip, deflate';
            } else {
                $encoding = 'identity';
            }
            $this->setHeader('Accept-Encoding', $encoding);
        }
    }
private function adjustHeaders($requestType)
    {
        if (! array_key_exists('Accept', $this->headers) && $requestType != 'HEAD') {
            $this->setHeader('Accept', 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8');
        }
        
        if (! array_key_exists('Accept-Language', $this->headers) && $requestType != 'HEAD') {
            $this->setHeader('Accept-Language', 'en-US;q=0.7,en;q=0.3');
        }
        
        if (! array_key_exists('User-Agent', $this->headers) && $requestType != 'HEAD') {
            $this->setHeader('User-Agent', 'phpGenerics 1.0');
        }
        
        if (! array_key_exists('Connection', $this->headers) || strlen($this->headers['Connection']) == 0) {
            $this->adjustConnectionHeader($requestType);
        }
        
        if (! array_key_exists('Accept-Encoding', $this->headers)) {
            if (function_exists('gzinflate')) {
                $encoding = 'gzip, deflate';
            } else {
                $encoding = 'identity';
            }
            $this->setHeader('Accept-Encoding', $encoding);
        }
    }
private function adjustHeaders ( $ requestType ) { if ( ! array_key_exists ( 'Accept' , $ this -> headers ) && $ requestType != 'HEAD' ) { $ this -> setHeader ( 'Accept' , 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' ) ; } if ( ! array_key_exists ( 'Accept-Language' , $ this -> headers ) && $ requestType != 'HEAD' ) { $ this -> setHeader ( 'Accept-Language' , 'en-US;q=0.7,en;q=0.3' ) ; } if ( ! array_key_exists ( 'User-Agent' , $ this -> headers ) && $ requestType != 'HEAD' ) { $ this -> setHeader ( 'User-Agent' , 'phpGenerics 1.0' ) ; } if ( ! array_key_exists ( 'Connection' , $ this -> headers ) || strlen ( $ this -> headers [ 'Connection' ] ) == 0 ) { $ this -> adjustConnectionHeader ( $ requestType ) ; } if ( ! array_key_exists ( 'Accept-Encoding' , $ this -> headers ) ) { if ( function_exists ( 'gzinflate' ) ) { $ encoding = 'gzip, deflate' ; } else { $ encoding = 'identity' ; } $ this -> setHeader ( 'Accept-Encoding' , $ encoding ) ; } }
Adjust the headers by injecting default values for missing keys.
Adjust the headers by injecting default values for missing keys .