Skip to content

resMerge

Intelligently merges the specified data object into the response content. Supports the following response types:

  • JSON (response content-type contains the json keyword)
  • JSONP (response content-type is empty or contains the html/javascript keywords)

Rule Syntax

txt
pattern resMerge://value [filters...]
ParametersDescriptionDetailed Documentation
patternExpression to match against the request URLMatch Pattern Documentation
valueOperation data object. Supports retrieval from the following sources:
• Directory/File Path
• Remote URL
• Inline/Embedded/Values content
Operation Instruction Documentation
filtersOptional 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

  1. Replace with a keyword or regular expression: resReplace
  2. Modify the request content object: reqMerge