Question

On a Drupal6 installation I have the REST service enabled (6.x-3.3).

All seems to setup correctly, but I cannot query any data and get always 404 Not Found.

What is the correct URL for retieve node #1:

    http://local.host/rest/node/1
    http://local.host/services/rest/node/1

None of them returns any data.

$endpoint = new stdClass;
$endpoint->disabled = FALSE; /* Edit this to true to make a default endpoint disabled initially */
$endpoint->api_version = 3;
$endpoint->name = 'rest';
$endpoint->server = 'rest_server';
$endpoint->path = 'rest';
$endpoint->authentication = array();
$endpoint->server_settings = array(
  'rest_server' => array(
    'formatters' => array(
      'json' => TRUE,
      'bencode' => FALSE,
      'jsonp' => FALSE,
      'php' => FALSE,
      'rss' => FALSE,
      'xml' => FALSE,
      'yaml' => FALSE,
    ),
    'parsers' => array(
      'application/json' => TRUE,
      'application/vnd.php.serialized' => FALSE,
      'application/x-www-form-urlencoded' => FALSE,
      'application/x-yaml' => FALSE,
      'multipart/form-data' => FALSE,
    ),
  ),
);
$endpoint->resources = array(
  'node' => array(
    'operations' => array(
      'retrieve' => array(
        'enabled' => 1,
      ),
      'create' => array(
        'enabled' => 1,
      ),
      'update' => array(
        'enabled' => 1,
      ),
      'delete' => array(
        'enabled' => 1,
      ),
      'index' => array(
        'enabled' => 1,
      ),
    ),
    'relationships' => array(
      'files' => array(
        'enabled' => 1,
      ),
      'comments' => array(
        'enabled' => 1,
      ),
    ),
  ),
  'system' => array(
    'actions' => array(
      'connect' => array(
        'enabled' => 1,
      ),
      'get_variable' => array(
        'enabled' => 1,
      ),
      'set_variable' => array(
        'enabled' => 1,
      ),
      'del_variable' => array(
        'enabled' => 1,
      ),
    ),
  ),
);
$endpoint->debug = 0;

Update

Get this running now:

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with drupal.stackexchange
scroll top