I have referred many links including the following:
- Services module. How to construct the JSON data with session info for creating node?
- GitHub - Creating a node using Services 6.3 REST
I tried several ways to POST a new node to a Drupal site, but I have failed. I have created a sample CCK for storing students data with name, age, gender, DOB, and added some list.
I have installed and configured the Services module (D7), and created a service end point at services.
As expected, GET is the easiest way to get details of a node in JSON. http://localhost/drupal/services/node
simply listed all nodes.
I still can't figure out how to use the POST method.
I would like to search for the students whose name contains john. I tried
localhost/drupal/services/node&node[name]=john
. I used POST Man plugin for Chrome without success. I also tried some other ways.I tried adding a new student to the site without success.
Can anyone guide me to make the above work fine?
UPDATE :
I tried adding new nodes of type article . It worked fine. but when i am trying to add nodes of type Department CCK It is showing "s:22:"CSRF validation failed";" Here are the screen shots
I have gone through the link https://drupal.org/node/2013781
I followed session = session_name=session_id but i still get an error.