resMerge
Intelligently merges the specified data object into the response content. Supports the following response types:
- JSON (response
content-type
contains thejson
keyword) - JSONP (response
content-type
is empty or contains thehtml
/javascript
keywords)
Rule Syntax
txt
pattern resMerge://value [filters...]
Parameters | Description | Detailed Documentation |
---|---|---|
pattern | Expression to match against the request URL | Match Pattern Documentation |
value | Operation data object. Supports retrieval from the following sources: • Directory/File Path • Remote URL • Inline/Embedded/Values content | Operation Instruction Documentation |
filters | Optional filters. Supports matching against: • Request URL/Method/Header/Content • Response Status Code/Headers | Filter Documentation |
Configuration Example
Inline Method
txt
www.example.com/path resMerge://test=123 file://({"name":"avenwu"})
Visiting https://www.example.com/path/to
, the browser receives the following:
js
{"name":"avenwu","test":"123"}
Inline Method
txt
``` resMerge.json
a.b.c: 123
c\.d\.e: abc
```
www.example.com/path resMerge://{resMerge.json} file://({"name":"avenwu"})
Visiting https://www.example.com/path/to
Content received by the browser:
js
{"name":"avenwu","a":{"b":{"c":123}},"c.d.e":"abc"}
Local/Remote Resources
txt
www.example.com/path1 resMerge:///User/xxx/test.json
www.example.com/path2 resMerge://https://www.xxx.com/xxx/params.json
# Editing a temporary file
www.example.com/path3 resMerge://temp/blank.json
Association Protocol
- Replace with a keyword or regular expression: resReplace
- Modify the request content object: reqMerge