Closed (fixed)
Project:
JSON server
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
4 Nov 2009 at 18:35 UTC
Updated:
3 Feb 2010 at 20:45 UTC
I'm trying to understand if my server json works, but when I try to use curl to check the methods I always get this error:
{ "#error": true, "#data": "Invalid method " }
This is what I used:
curl --data method=system.connect http://mysite.com/mydrupalfolder/services/json
Just to give you more information: my installation is not in the root of my site and I have clean URL's enabled.
Any idea?
Thank you in advance.
Comments
Comment #1
nicholasthompsonThe method's value is considered a JSON value. For a JSON value to be a string, it should be enclosed in double quotes. This threw me for several hours too...
Try:
Please re-open if this does not help...
Comment #3
myktra commentedYes, I'm receiving this as well on latest dev build, calling curl from multiple workstations, including the server Drupal is running on. My site is also not in the root folder.
curl --data method=\"system.connect\" http://my-server/my-drupalrootfolder/?q=services/json
curl --data method=\"system.connect\" http://my-server/my-drupalrootfolder/services/json
{ "#error": true, "#data": "Invalid method system.connect" }
The Services service module is installed and the JSON server appears in the Servers section in /admin/build/services.
Not sure if this is related but I am also seeing this error message in /admin/build/services/browse/system.connect
warning: Invalid argument supplied for foreach() in /srv/www/my-server/public_html/ww/sites/all/modules/json_server/json_server.module on line 28.
Services 6.x-2.x-dev
JSON server module 6.x-1.x-dev
Thoughts?
Comment #4
upupax commentedNo.. I'm still having the same problem too...
Comment #5
chuckfletcher commentedI have the same issue. Any ideas on this?
Comment #6
chuckfletcher commentedI see a different error in system.connect: warning: call_user_func_array() expects parameter 2 to be array, null given in myserver/modules/services/services.module on line 411.
Comment #7
ilo commentedDo you all have the same issue, and do you all use services module version 6.x-2.0? If you take a look to the services issue queue there is a major redesign ongoing for development branches. Does this module work with the stable release of services? did you try?
Comment #8
burningdog commentedJSON Server doesn't work with the stable release of Services (6.x-2.0-beta1) unless the patch at #4 is applied from #663744: JSON Server returns "invalid method" for all function calls with Services 6.x-2.x-dev.
@myktra, once you've applied that patch, try:
curl --data 'method="system.connect"' http://my-server/my-drupalrootfolder/services/jsonIt took me a while to find the format which worked. Using arguments is like so:
curl --data 'method="my_module.connect"' --data 'name="Roger Saner"' --data 'mail="me@example.com"' http://example.com/?q=services/json