2

I am trying to create a json rpc client to access drupal services provided by services module for titanium.

function connect()
{
  var loader = Titanium.Network.createHTTPClient();

  var url = "http://10.0.2.2/service/services/json";

  loader.open("POST",url);

  loader.onload = function()
  {
    alert(this.responseText);
  };

  loader.send({"method:'system.connect'"});
} 

This code results saying 'invalid method'.

I think the parsing of the data is not in the correct format. Please help to resolve this problem.

qasimzee
  • 640
  • 1
  • 12
  • 30
Piyuesh Kumar
  • 436
  • 5
  • 21

1 Answers1

0

Update your code like this :

loader.send({method:'system.connect'});

Refer Working with JSON Data in Drupal for more details .

Sujith PS
  • 4,776
  • 3
  • 34
  • 61