You are here

protected function RESTServer::getResponseFormatContentTypeNegotiations in Services 7.3

Determine response format and mime type using headers to negotiate content types.

Parameters

string $mime_type: Mime type. This variable to be overriden.

string $canonical_path: Canonical path of the request.

array $formats: Enabled formats by endpoint.

Return value

string Negotiated response format. For example 'json'.

1 call to RESTServer::getResponseFormatContentTypeNegotiations()
RESTServer::getResponseFormatter in servers/rest_server/includes/RESTServer.inc
Response formatter is responsible for encoding the response.

File

servers/rest_server/includes/RESTServer.inc, line 240
Class for handling REST calls.

Class

RESTServer
@file Class for handling REST calls.

Code

protected function getResponseFormatContentTypeNegotiations(&$mime_type, $canonical_path, $formats) {
  return $this->negotiator
    ->getResponseFormatContentTypeNegotiations($mime_type, $canonical_path, $formats, $this->context);
}