src/Http/Response.php
public function negotiate($request)
    {
        $media = $this->_classes['media'];
        foreach ($request->accepts() as $mime => $value) {
            if ($format = $media::suitable($request, $mime)) {
                $this->format($format);
                return;
            }
        }
        $mimes = join('", "', array_keys($request->accepts()));
        throw new NetException("Unsupported Media Type: [\"{$mimes}\"].", 415);
    }
public function negotiate($request)
    {
        $media = $this->_classes['media'];
        foreach ($request->accepts() as $mime => $value) {
            if ($format = $media::suitable($request, $mime)) {
                $this->format($format);
                return;
            }
        }
        $mimes = join('", "', array_keys($request->accepts()));
        throw new NetException("Unsupported Media Type: [\"{$mimes}\"].", 415);
    }
public function negotiate ( $ request ) { $ media = $ this -> _classes [ 'media' ] ; foreach ( $ request -> accepts ( ) as $ mime => $ value ) { if ( $ format = $ media :: suitable ( $ request , $ mime ) ) { $ this -> format ( $ format ) ; return ; } } $ mimes = join ( '", "' , array_keys ( $ request -> accepts ( ) ) ) ; throw new NetException ( "Unsupported Media Type: [\"{$mimes}\"]." , 415 ) ; }
Performs a format negotiation from a `Request` object, by iterating over the accepted
content types in sequence, from most preferred to least.

@param  object $request A request instance .
Performs a format negotiation from a Request object by iterating over the accepted content types in sequence from most preferred to least .