HTTP Message Body Rewrite
Message body rewriting allows users to modify the body of HTTP requests or responses that match specific URLs. This feature can be used to replace or modify specific text fragments. Below is a detailed explanation of each field:
Field | Type | Required | Description |
---|---|---|---|
match | string | Yes | Used to match the URL |
find | string | Yes | Regular expression used to search the body |
replace | string | Yes | Used to replace the found content (supports wildcard matching in regex) |
type | string | Yes | Type (can be request or response) |
body_rewrites:
- match: "http://www\\.egernapp\\.com/egern.html"
find: egern
replace: nrene
type: response
In the example above, the system will look for all response types where the URL matches "http://www.egernapp.com/egern.html". It will then search for "egern" in the message body and replace it with "nrene".
This feature can be useful in various scenarios, such as injecting data into the request body or modifying returned response data.