This topic describes the characteristics of different match values in rules and how to use these match values.
Strings
Strings are text data consisting of characters and represent text or information. Strings are enclosed with double quotation marks (") or quotation marks (').
Usage notes
No limits are imposed on string lengths, but excessively long strings may impact performance.
Special characters, such as backslashes (
\), must be escaped.
Example
"example": "This is a string."Boolean values
Boolean values include only true and false, which are commonly used in conditional judgment and logical operations.
Usage notes
Do not confuse Boolean values with strings. Boolean values do not require quotation marks.
Example
"enabled": trueObjects
An object is a collection of key-value pairs, where each key (attribute) is a string and each value can be of any data type. Objects are enclosed with braces ({}), and key-value pairs within an object are separated with commas (,).
Usage notes
Keys within an object must be unique.
Do not use complex nested object structures during rule configuration.
Example
"requestHeaders": {
"User-Agent": "Mozilla/5.0",
"Accept": "application/json"
}Numbers
Numbers can be integers or floating-point numbers and support regular mathematical operations.
Usage notes
Use appropriate number formats, such as decimal and floating-point numbers, to prevent unexpected format conversions.
Example
"timeout": 30Arrays
An array is a collection of ordered values. Arrays can contain values of any data types, including other arrays and objects. Arrays are enclosed in brackets ([]) and values in an array are separated with commas (,).
Usage notes
Array lengths are adjustable. You can add elements to or remove elements from an array.
To enhance code readability, do not use different data types within an array.
Example
"allowedMethods": ["GET", "POST", "DELETE"]