/** * @param \WoohooLabs\Yin\JsonApi\Request\RequestInterface $request * @throws \Exception */ public function negotiate(RequestInterface $request) { try { $request->validateContentTypeHeader(); $request->validateAcceptHeader(); } catch (MediaTypeUnacceptable $e) { throw $this->exceptionFactory->createMediaTypeUnacceptableException($request, $e->getMediaTypeName()); } catch (MediaTypeUnsupported $e) { throw $this->exceptionFactory->createMediaTypeUnsupportedException($request, $e->getMediaTypeName()); } }