2

I have a backend service written by Python, which is exposed a JSON api. And I want drupal to perform an HTTP POST/PUT/PATCH/DELETE... request with json data (which is an output of a node) to the backend when a node have been created/modified/deleted.

I think that rules module should do this job. The trigger part and condition part are ok, but I can't find a suitable action part.

I hope to find a module that provides some rule actions, is able to let me define the JSON structure being used (using token etc.), is able to perform an HTTP request(GET/POST/PUT/DELETE) and let me handle the response (notify users or save to a status field).

When I google solutions, I only found two possible modules:

But it seems not support authorization (OAuth/HMAC/token/...), and the data has to be HTTP query string (?name=value&name2=value2&...).

This is a very powerful module, allows to define a series of actions: transform a node to a data structure and save as a variable, call http request with the variable and save the response as a result variable, handle the result at last. BUT, it only supports GET method (only option), query string, and no HTTP headers.

With these modules, I can work out a backup solution: my backend service may supply an endpoint that handles formed data, or supply an endpoint that receives a node id then make a HTTP request callback to Drupal (with services module).

Do I miss any module that do similar thing? Or is there any better solution?

P.S.: I'm not familiar with PHP, so I don't want to write any PHP code.

1

Guzzle is similar to Web Service Client and there is also Web Rules but I assume Guzzle would require some coding. Guzzle is a powerful HTTP client and library and itself can do whatever you want.

The reason there are few user interfaces to what you want is that they're annoying to build and add next to nothing to your client website. The UIs dont make the website any faster, they're just bloat.

This is why Views and ViewsUI are decoupled so you can turn 1 off in production environments.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.