docs/en/docs/rules/resCharset.md
Modify the charset portion of the content-type response header to set the encoding of the response content.
content-typestructure:txt<media-type>; charset=<encoding>
pattern resCharset://encoding [filters...]
| Parameters | Description | Detailed Documentation |
|---|---|---|
| pattern | Expression to match against the request URL | Match Pattern Documentation |
| encoding | Encoding name, such as utf8 | |
| • Inline/Embedded/Values content | ||
| ⚠️ Loading data from files/remote URLs is not supported | ||
| filters | Optional filters, supporting matching: | |
| • Request URL/Method/Header/Content | ||
| • Response Status Code/Header | Filter Documentation |
# Set response encoding and response header `content-type` Empty fields are changed to `; charset=utf8`
www.example.com/path resCharset://utf8
# Set the response encoding. The empty `content-type` response header field is changed to `text/html; charset=utf8`
www.example.com/path resType://json resCharset://utf8