To automate backend interactions, it's often useful to fetch, transform, and forward data between services without involving the client.
This example shows how to fetch a product, modify its data (e.g. price), and post the transformed product back to the API using dynamic property handling and templating.
-
Start the Router
./membrane.sh # Linux/Mac membrane.bat # Windows
-
Test the flow:
curl -i http://localhost:2000
- Fetches product with ID
14. - Extracts the
nameandpricefrom the response ($.name,$.price). - Increments the price by 1.
- Builds a new JSON body using the modified values.
- Sends a
POSTrequest to create a new product with the updated data.
Check proxies.xml to see the configuration.