You are here

function hook_rest_server_response_formatters_alter in Services 7.3

Same name in this branch
  1. 7.3 docs/services.alter.api.php \hook_rest_server_response_formatters_alter()
  2. 7.3 servers/rest_server/rest_server.api.php \hook_rest_server_response_formatters_alter()
Same name and namespace in other branches
  1. 6.3 servers/rest_server/rest_server.api.php \hook_rest_server_response_formatters_alter()

Triggered when the REST server request a list of supported response formats.

Parameters

array $formatters: An associative array of formatter info arrays keyed by type extension. The formatter info specifies an array of 'mime types' that corresponds to the output format; a 'formatter class' class implements ServicesFormatterInterface and is responsible for encoding the output.

Return value

void

1 invocation of hook_rest_server_response_formatters_alter()
rest_server_response_formatters in servers/rest_server/rest_server.module
Builds a list of response formatters that are available to the RESTServer.

File

servers/rest_server/rest_server.api.php, line 34
Hooks provided by Services for the definition of servers.

Code

function hook_rest_server_response_formatters_alter(&$formatters) {

  // Remove the jsonp response format.
  unset($formatters['jsonp']);
}