protected function determineMediaType($acceptHeader)
    {
        if (!empty($acceptHeader)) {
            $negotiator = new Negotiator();
            $mediaType = $negotiator->getBest($acceptHeader, $this->knownMediaTypes);

            if ($mediaType) {
                return $mediaType->getValue();
            }
        }

        return $this->getDefaultMediaType();
    }
protected function determineMediaType($acceptHeader)
    {
        if (!empty($acceptHeader)) {
            $negotiator = new Negotiator();
            $mediaType = $negotiator->getBest($acceptHeader, $this->knownMediaTypes);

            if ($mediaType) {
                return $mediaType->getValue();
            }
        }

        return $this->getDefaultMediaType();
    }
protected function determineMediaType ( $ acceptHeader ) { if ( ! empty ( $ acceptHeader ) ) { $ negotiator = new Negotiator ( ) ; $ mediaType = $ negotiator -> getBest ( $ acceptHeader , $ this -> knownMediaTypes ) ; if ( $ mediaType ) { return $ mediaType -> getValue ( ) ; } } return $ this -> getDefaultMediaType ( ) ; }
Read the accept header and determine which media type we know about
is wanted.

@param  string $acceptHeader Accept header from request
@return string
Read the accept header and determine which media type we know about is wanted .