function rest_server_server in Services 6.3
Same name and namespace in other branches
- 7.3 servers/rest_server/rest_server.module \rest_server_server()
Starting point of the REST server.
Return value
type
File
- servers/
rest_server/ rest_server.module, line 36
Code
function rest_server_server() {
$endpoint_path = services_get_server_info('endpoint_path', 'services/rest');
$endpoint_path_len = drupal_strlen($endpoint_path) + 1;
$canonical_path = drupal_substr($_GET['q'], $endpoint_path_len, drupal_strlen($_GET['q']) - $endpoint_path_len);
if (empty($canonical_path)) {
return;
}
try {
$server = new RESTServer();
return $server
->handle($canonical_path, $endpoint_path);
} catch (Exception $e) {
$server
->handleException($e);
}
}