function _restclient_authentication_request_error in RESTClient 7.2
Handle authentication-related request errors, and indicate if the request can be retried. This can be the case for situations where the token had expired: we re-authenticate and indicate that the request can be re-attempted.
2 calls to _restclient_authentication_request_error()
- _restclient_request in ./
restclient.module - Basic request with no body data.
- _restclient_request_with_body in ./
restclient.module - Requests with body data.
File
- ./
restclient.module, line 1043 - Defines a standard REST interface to RESTful services
Code
function _restclient_authentication_request_error($response, $variables) {
// If authentication is not specified for some reason, return FALSE;
if (!isset($variables['authentication'])) {
return FALSE;
}
$authentication_type = NULL;
if (isset($variables['authentication']['type'])) {
$authentication_type = $variables['authentication']['type'];
}
$return_value = FALSE;
switch ($authentication_type) {
case 'hybridauth':
$return_value = _restclient_authentication_hybridauth_request_error($response, $variables);
break;
default:
// The authentication method is not supported or was not specified. Do nothing.
break;
}
return $return_value;
return FALSE;
}