reqCookies
Modify the request Cookie
header.
Rule Syntax
txt
pattern reqCookies://value [filters...]
Parameters | Description | Detailed Documentation |
---|---|---|
pattern | Expression to match against the request URL | Match Pattern Documentation |
value | Cookie object, supported from the following sources: • Directory/File Path • Remote URL • Inline/Embedded/Values Content | Operation Instruction Documentation |
filters | Optional filters, supported for matching against: • Request URL/Method/Header/Content • Response Status Code/Header | Filter Documentation |
Cookie object structure: key-value
Configuration Example
Inline Method
txt
www.example.com/path reqCookies://k1=v1&k2=v2
Add two request cookies to the request header: k1: v1
/ k2: v2
Inline Mode
txt
``` cookies.json
key1: value1
key2: value2
```
# Or
``` cookies.json
{
key1: 'value1',
key2: 'value2'
}
```
www.example.com/path reqCookies://{cookies.json}
Add two request cookies to the request header: key1: value1
/ key2: value2
Local/Remote Resources
txt
www.example.com/path1 reqCookies:///User/xxx/test.json
www.example.com/path2 reqCookies://https://www.xxx.com/xxx/params.json
# By editing a temporary file
www.example.com/path3 reqCookies://temp/blank.json
Related Protocols
- Delete request cookies: delete://reqCookies.xxx
- Delete all request cookies: delete://reqHeaders.cookie