function hook_restws_request_alter in RESTful Web Services 7
Same name and namespace in other branches
- 7.2 restws.api.php \hook_restws_request_alter()
Alter the incoming request array.
Parameters
array $request: A request array that contains the following items:
- op: operation string, one of create, read, update or delete.
- format: object implementing RestWSFormatInterface.
- resource: object implementing RestWSResourceControllerInterface.
- id: resource identifier or NULL for the create operation.
- payload: array containing data attached to this request, if any.
Related topics
1 function implements hook_restws_request_alter()
Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.
- restws_basic_auth_restws_request_alter in restws_basic_auth/
restws_basic_auth.module - Implements hook_restws_request_alter().
1 invocation of hook_restws_request_alter()
- restws_handle_request in ./
restws.module - Handles a request.
File
- ./
restws.api.php, line 120 - This file contains no working PHP code; it exists to provide additional documentation for doxygen as well as to document hooks in the standard Drupal manner.
Code
function hook_restws_request_alter(array &$request) {
if ($request['resource']
->resource() == 'node') {
$request['format'] = restws_format('json');
}
}