So I am having to take a very crash course in the REST Server module as I'm trying to help out some other developers. Please excuse me if this question just sounds very dumb.
I am still working on the site in question, but I created a new Drupal site from scratch, loaded up some nodes with Devel, installed Services (6.x-2.4) and REST Server (6.x-2.0-beta3) modules. Dependencies are also installed (Autoload 6.x-2.0 & Input Stream 6.x-1.0). Enabled Services, REST Server and Node Service.
I was expecting to be able to use something like:
http://example.com/services/rest/node/1
..but that didn't work. Tracing through the code, it exits with a 404 error. So I look more carefully at the README, and it also talks about /services/rest/node/123
So I do more tracing through the code and I come up with a URL that works for me:
http://example.com/services/rest/service_node/get.json?nid=1
So what gives? Is this the correct URL format for me to be using? Why does the README talk about '/services/rest/node/123'.
My limited exposure to RESTful services tells me that it should be something like /services/rest/node/123.
So is /services/rest/service_node/get?nid=1 the correct URL structure that I should be using? Is that discussed anywhere in documentation or readme files?
Thanks!
Comments
Comment #1
jonmcl commentedOh and a quick follow-up. I forgot to add that I also had to install a patch I found to make it work at all. (Because I forgot I installed it)
The patch was in this issue:
#825412: rest call to GET services_view with argument returns 404 not found
So what gives? I must be doing something wrong if I'm depending on that patch and the URLs that don't match the readme. Or am I doing everything right? :)
Comment #2
brettbirschbach commentedThe documentation for this module appears to be out of date, and I don't know of any up-to-date documentation out there.
Adding to the confusion and frustration, the REST server is included in the Services 3.x module, but the documentation is still not updated, and the functionality is definitely different.
For instance, in Services 3.x, I can call my REST server with {endpoint}/comment?parameters[nid]=1 and I will get all comments for node ID 1. Note that the parameter is "parameters[nid]", not "nid". In Services 2.x, which the documentation refers to, supposedly we can get comments for node 1 using {endpoint}/comment?nid=1, but it doesn't work (at least not for me). parameters[nid] doesn't fix it for Services 2 (for me) either.