Probably not a bug, though, so I didn't want to reopen an old issue. Probably just me not getting something.
The error is: { "#error": true, "#data": "Invalid method " }
What I've tried is many variations on the following two themes:
$.post('http://my.site/services/json', {"method":"views.get","view_name":"my_view"});
$.ajax({
type: 'POST',
url: 'http://my.site/services/json',
data: {"method": "views.get", "view_name":"my_view"},
dataType: "json",
});I'm just trying this in Firebug at the moment, trying to get a response back so I can build from there. I've noticed many other people reporting the same error, but I've tried both 6.x-2.0-alpha2 and 6.x-2.x-dev, both Services 6.x-2.2, and I had gathered both of those versions included a patch to fix this problem. So I have to figure I'm doing something very basic wrong, which is likely as I'm having to learn javascript on the fly here. Can anyone show me my error here?
Comments
Comment #1
dodwyer commentedI found I had the same issues until I enabled the additional service modules, System Service, Views Service etc
Hope this helps.
Comment #2
wrd commentedThanks for the reply! I had views service enabled, but none of the others. Unfortunately, I'm getting the same result with all services enabled. I feel like I must just be doing something wrong in my post syntax, just not sure what.
Comment #3
mill0234 commentedTry:
The php json_decode function is used so you have to wrap the arguments in a single - double quotes (i.e. '"arg"').
Comment #4
wrd commentedBingo! Many thanks!
Comment #5
pmathur01 commentedHi,
I am getting the same error .. I am new to json and webservices. I installed the webservices module. I enabled all the services eg. node, system, user, echo. I am trying to access node.get from drupal cloud android app and I always get this error.
{ "#error": true, "#data": "Invalid method " }.
Even when I browse the service module on my webserver and click on json server I get this error. Can you please guide me with the issue.
Prerna
Comment #6
surbhipatel commentedHello Everyone
I am new to the jsonserver and services module . I configured both the module in the site http://openxcelluk.info/test site . When ever I click on http://openxcelluk.info/test/services/json link I get { "#error": true, "#data": "Invalid method " } every time . Please help me what I have to do . Do I need to do any coding in the module. I even set the key.
Comment #7
jaypanBump. What is the format of the POST data supposed to be? I cannot get any response other than #invalid method.
Comment #8
skyredwangComment #9
jaypanThis wasn't fixed, I never got a response.