Drupal service (service module) examples

Call a drupal service (service module) using curl example:

curl -i http://localhost/voc/taxonomy_vocabulary/getTree --header 'Content-Type: application/json' --header 'Accept: application/json' --data '{"vid":"yourvid"}'

You should be using 'operations' in services module for the post.

Post examples;


curl -H 'Content-type: application/json' -X POST -d '"param1":"value1","param2":[{"value":"test"}]'

[{"value":"test"}] is a array


GET examples;

http://localhost/gopi/taxonomy_term?page=0&fields=name,weight&options[orderby][name]=desc


q=endpoint/taxonomy_term.json&fields=tid,name&parameters[name]=%foo%&options[parameters_op][name]=like&options[orderby][name]=asc

Comments

Popular posts from this blog

Programatically create layout builder section in Drupal

Code quality analysis of Drupal. Can I use Sonar?

Set up Drupal7 to Drupal8 migration in simple steps (using Drush)