Adding a Content Replacement Rule
Scenario
A content replacement rule allows for interface content substitution based on the key name.
For example, if you want to replace the content Yang xx in the demo API with Zhang San, you can use a content replacement rule.
This topic describes how to create a content replacement rule.
Procedure
- Log in to the web console of the API data security protection system as the sysadmin user.
- In the navigation pane, choose .
- On the Content Replace page, click Add and set content replacement rule parameters. For the description of parameters, see Parameters for adding a content replacement rule.
Figure 1 Configuring a content replacement rule
Table 1 Parameters for adding a content replacement rule Parameter
Description
Rule name
Name of a customized content replacement rule.
Description
Enter the rule description.
Service name
Select an application to which the rule applies from the drop-down list.
Endpoint URL
Select and configure interface matching conditions. If multiple interfaces are entered, separate them with line breaks. The rule is triggered when one of the interfaces is matched.
Replacement rules
Set the parameters of the replacement rule.- Location: Select the location of the content to be replaced.
- Key: Enter the key name of the content to be replaced.
- Replace type: Select a matching mode, which can be keyword or regular expression.
- Source: Enter the original content to be replaced.
- Target: Enter the content after replacement.
File type
Select the file type to which the rule applies, including json, html, js, and xml.
- Click OK.
Operation Result
After the rule is added and enabled, you can use a proxy to access the application and view the replacement content.
Related Operations
On the Content Replace page, you can also perform the following operations:
- Modifying a rule: Locate the target rule and click Edit on the right.
- Deleting a rule: Locate the target rule and click Delete on the right.
- Deleting rules in batches: Select multiple rules and click Delete in the upper right corner.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot