docs/en/docs/rules/resWriteRaw.md
Saves the complete response content (including protocol, status code, status information, response headers, and content) to a specified directory or file. This method is suitable for scenarios where response data needs to be recorded:
pattern resWriteRaw://fileOrDirPath [filters...]
| Parameters | Description | Detailed Documentation |
|---|---|---|
| pattern | Expression to match the request URL | Match Pattern Documentation |
| fileOrDirPath | Directory or file path to store data | |
| filters | Optional filters, supporting matching: • Request URL/Method/Headers/Content • Response Status Code/Headers | Filters Documentation |
wproxy.org/docs resWriteRaw:///User/xxx/test/
When accessing a specific file
https://wproxy.org/docs/test.html
→ Save to: /User/xxx/test/test.html
When accessing a directory path
https://wproxy.org/docs/
→ Save to: /User/xxx/test/index.html (The target path is /User/xxx/test/, and a trailing / or \ automatically appends index.html)
wproxy.org/docs/resWriteRaw:///User/xxx/test/
When Accessing a Sub-Path
https://wproxy.org/docs/test.html
→ Still Saved to: /User/xxx/test/test.html
When Accessing a Configuration Directory
https://wproxy.org/docs/
→ Saved Directly to: /User/xxx/test/ (as a Whole File)
💡 Key Differences:
- Whether the rule path ends with
/or\determines how directory requests are saved- Non-directory paths (without a trailing
/or\) are saved directly to the specified file- Directory paths (with a trailing
/or\) are automatically completed toindex.html
/^https://wproxy\.org/docs/(\?.*)?$ resWriteRaw:///User/xxx/test/index.html
Limit the request URL using regular expression matching