I’m currently working with Kong and I need to modify the body of upstream responses based on certain conditions. Specifically, I want to modify the body only if the request is a POST request. I’ve tried using the “response transformer” plugin, but I can’t figure out how to add this specific condition.
Here are the points I need clarification on:
- Did I misconfigure the “response transformer” plugin?
- Is it possible to add such a condition with the existing plugin?
- Do I need to develop a custom plugin to achieve this functionality?
I configured the “response transformer” plugin to modify the response body. The plugin works, but it applies the transformation to all response bodies regardless of the request method. I expected to find an option to conditionally apply the transformation based on the request method (only for POST requests), but I couldn’t locate such an option in the plugin’s configuration.
Bacem S is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.