function hook_wsclient_rest_request_alter in Web service client 7
Alter the HTTP request.
Parameters
HttpClientRequest $request: The http request to be manipulated before it's handed over to curl.
WSClientServiceDescription $service: The web service description.
See also
WSClientRESTEndpoint::alterRequest()
Related topics
1 invocation of hook_wsclient_rest_request_alter()
- WSClientRESTEndpoint::alterRequest in wsclient_rest/
wsclient_rest.inc - Alters the given request.
File
- wsclient_rest/
wsclient_rest.api.php, line 27 - 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_wsclient_rest_request_alter(&$request, &$service) {
if ($service->name == 'myservice') {
// Remove empty parameters.
$request->parameters = array_filter($request->parameters, 'strlen');
}
}