uri.Apache ShenYu gateway allows users to use the request plugin to add, modify, and remove request headers to request parameters, request headers, and Cookie when proxying a target service.Core Module shenyu-plugin-request
Core Class org.apache.shenyu.plugin.request.RequestPlugin
pom.xml file, which is already added by default.<dependency> <groupId>org.apache.shenyu</groupId> <artifactId>shenyu-spring-boot-starter-plugin-request</artifactId> <version>${project.version}</version> </dependency>
In shenyu-admin --> BasicConfig --> Plugin --> request set Status enabled.
If there is an option to configure a
ruleHandlePageTypeon the page here, you can configure any string, e.g.custom, which has no effect on the request, and will be removed in later versions.
selectors and rules, only requests that match are forwarded and redirected, see the Selector And Rule Config
shenyu-admin Plugin --> HttpProcess --> Request. Add the selector first, then add the rule:
Add the selector:
Add the rule
Rules, it should be a reachable service path.Apache ShenYu gateway performs a service hop.Calling the interface declared by the selector and rule will see the request parameters configured in the request plugin.
shenyu-admin --> BasicConfig --> Plugin --> request set Status disable.