Skip to content

reqMerge

Intelligently merges specified data objects into the request body, suitable for modifying partial parameters without affecting the remaining content. Supports multiple request formats:

  • Regular form data (application/x-www-form-urlencoded)
  • File upload form (multipart/form-data)
  • JSON requests (application/json)

Rule Syntax

txt
pattern reqMerge://value [filters...]
ParametersDescriptionDetailed Documentation
patternExpression to match against the request URLMatch Pattern Documentation
valueOperation data object, supported from the following sources:
• Directory/file path
• Remote URL
• Inline/embedded/Values content
Operation Instruction Documentation
filtersOptional filters, supported for matching:
• Request URL/Method/Headers/Content
• Response Status Code/Headers
Filter Documentation

Configuration Example

Inline Method

txt
www.example.com/path reqMerge://test=123 reqBody://(name=avenwu) reqType://form method://post

Request content received by the server when accessing https://www.example.com/path/to:

txt
name=avenwu&test=123

Inline Method

txt
``` reqMerge.json
a.b.c: 123
c\.d\.e: abc
```
www.example.com/path reqMerge://{reqMerge.json} reqBody://({"name":"avenwu"}) reqType://json method://post

Access https://www.example.com/path/to and capture the request content:

js
{"name":"avenwu","a":{"b":{"c":123}},"c.d.e":"abc"}

Local/Remote Resources

txt
www.example.com/path1 reqMerge:///User/xxx/test.json
www.example.com/path2 reqMerge://https://www.xxx.com/xxx/params.json
# Editing a temporary file
www.example.com/path3 reqMerge://temp/blank.json

Note: Request Size Limit

To ensure processing performance, reqMerge enforces a default size limit for request content.

  • Limit Specification: The automatic merge processing is only applied to requests with a body size less than 2MB. Requests exceeding this size will be skipped.
  • How to Override: If you need to handle larger requests, you can explicitly enable this capability by adding the following directive to your matching rule:
txt
pattern enable://reqMergeBigData

# or
www.example.com/path1 reqMerge:///User/xxx/test.json lineProps://enableBigData

Once enabled, reqMerge will attempt to process larger request volumes. Please note that this may increase memory consumption and processing time.

  1. Inject content before the request content (Prepend To Body): reqPrepend
  2. Replace request content (Replace Body): reqBody
  3. Append content after the request content (Append To Body): reqAppend
  4. Replace request content using keywords or regular expressions: reqReplace
  5. Override JSON/Form objects in the request content: reqMerge
  6. Delete a property from a JSON/Form object in the request content: delete://reqBody.xxx