src/Http/Middleware/NegotiatesContent.php
protected function doContentNegotiation(
        HttpFactoryInterface $httpFactory,
        ServerRequestInterface $request,
        CodecMatcherInterface $codecMatcher
    ) {
        $parser = $httpFactory->createHeaderParametersParser();
        $checker = $httpFactory->createHeadersChecker($codecMatcher);

        $checker->checkHeaders($parser->parse($request, http_contains_body($request)));
    }
protected function doContentNegotiation(
        HttpFactoryInterface $httpFactory,
        ServerRequestInterface $request,
        CodecMatcherInterface $codecMatcher
    ) {
        $parser = $httpFactory->createHeaderParametersParser();
        $checker = $httpFactory->createHeadersChecker($codecMatcher);

        $checker->checkHeaders($parser->parse($request, http_contains_body($request)));
    }
protected function doContentNegotiation ( HttpFactoryInterface $ httpFactory , ServerRequestInterface $ request , CodecMatcherInterface $ codecMatcher ) { $ parser = $ httpFactory -> createHeaderParametersParser ( ) ; $ checker = $ httpFactory -> createHeadersChecker ( $ codecMatcher ) ; $ checker -> checkHeaders ( $ parser -> parse ( $ request , http_contains_body ( $ request ) ) ) ; }
Perform content negotiation.

@param HttpFactoryInterface $httpFactory
@param ServerRequestInterface $request
@param CodecMatcherInterface $codecMatcher
@throws JsonApiException
@see http://jsonapi.org/format/#content-negotiation
Perform content negotiation .