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:
- Rules HTTP Client, according to REST request through Actions and Triggers
This module adds an action wrapping of drupal_http_request() to use Rules for making HTTP requests.
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.