public matchEncoder ( Neomerx\JsonApi\Contracts\Http\Headers\AcceptHeaderInterface $acceptHeader ) : void | ||
$acceptHeader | Neomerx\JsonApi\Contracts\Http\Headers\AcceptHeaderInterface | |
return | void |
public function matchEncoder(AcceptHeaderInterface $acceptHeader);
/** * Check accept header * * @param AcceptHeaderInterface $header * @return Error */ private function checkAcceptHeader(AcceptHeaderInterface $header) { $this->matcher->matchEncoder($header); if (null === $this->matcher->getEncoderHeaderMatchedType()) { throw new JsonApiException($this->createApiError(JsonApiException::HTTP_CODE_UNSUPPORTED_MEDIA_TYPE, self::UNSUPPORTED_ACCEPT_ERROR, 'Unsupported media type'), JsonApiException::HTTP_CODE_UNSUPPORTED_MEDIA_TYPE); } }