Hash Filter¶
The Hash filter refers to the hash table of the values in any of the baseline request elements that may contain hash tables.
The Hash filter can be used in the point together with the following filters and parsers:
Use the keys to refer to the elements of the hash table addressed by the Hash filter.
Regular expressions in points
The key in the point can be a regular expression of the Ruby programming language.
The Example of Using the Get Filter and the Hash Filter¶
For the
request, the Hash filter applied to the id
query string parameter refers to the following hash table:
Key | Value |
---|---|
user | 01234 |
group | 56789 |
-
The
GET_id_HASH_user_value
point refers to the01234
value that corresponds with theuser
key from theid
query string parameter values hash table addressed by the Hash filter. -
The
GET_id_HASH_group_value
point refers to the56789
value that corresponds with thegroup
key from theid
query string parameter values hash table addressed by the Hash filter.
The Example of Using the Form_urlencoded parser with the Hash Filter¶
For the
request with the
body, the Hash filter applied to the id
parameter from the request body in the form-urlencoded format refers to the following array:
Key | Value |
---|---|
user | 01234 |
group | 56789 |
-
The
POST_FORM_URLENCODED_id_HASH_user_value
point refers to the01234
value that corresponds with theuser
key from the request body parameters hash table addressed by the Hash filter. -
The
POST_FORM_URLENCODED_id_HASH_group_value
point refers to the56789
value that corresponds with thegroup
key from the request body parameters hash table addressed by the Hash filter.
The Example of Using the Multipart Filter and the Hash Filter¶
For the
POST http://example.com/login/index.php HTTP/1.1
Content-Type: multipart/form-data;boundary="boundary"
--boundary
Content-Disposition: form-data; name="id[user]"
01234
--boundary
Content-Disposition: form-data; name="id[group]"
56789
request, the Hash filter applied to the id
parameter from the request body together with the Multipart parser refers to the following hash table:
Key | Value |
---|---|
user | 01234 |
group | 56789 |
-
The
POST_MULTIPART_id_HASH_user_value
point refers to the01234
value that corresponds with theuser
key from the request body parameters hash table addressed by the Hash filter. -
The
POST_MULTIPART_id_HASH_group_value
point refers to the56789
value that corresponds with thegroup
key from the request body parameters hash table addressed by the Hash filter.
The Example of Using the Json_doc Parser and the Hash Filter¶
For the
request with the
body, the Hash filter applied to the request body in the JSON format together with the Json_doc parser refers to the following hash table:
Key | Value |
---|---|
username | user |
rights | read |
-
The
POST_JSON_DOC_HASH_username_value
point refers to theuser
value that corresponds with theusername
key from the request body parameters hash table addressed by the Hash filter. -
The
POST_JSON_DOC_HASH_rights_value
point refers to theread
value that corresponds with therights
key from the request body parameters hash table addressed by the Hash filter.
The Example of Using the Json_obj Filter and the Hash Filter¶
For the
request with the
body, the Hash filter applied to the request body in the JSON format together with the Json_doc parser and the Json_obj filter refers to the following hash table:
Key | Value |
---|---|
status | active |
rights | read |
-
The
POST_JSON_DOC_JSON_OBJ_info_HASH_status_value
point refers to theactive
value that corresponds with thestatus
key from the info JSON object child objects hash table addressed by the Hash filter. -
The
POST_JSON_DOC_JSON_OBJ_info_HASH_rights_value
point refers to theread
value that corresponds with therights
key from the info JSON object child objects hash table addressed by the Hash filter.
The Example of Using the Json_array Filter and the Hash Filter¶
For the
request with the
{
"username": "user",
"posts": [{
"title": "Greeting",
"length": "256"
},
{
"title": "Hello World!",
"length": "32"
}
]
}
body, the Hash filter applied to the first element of the posts
JSON objects array from the request body together with the Json_doc parser and the Json_obj and Json_array filters refers to the following hash table:
Key | Value |
---|---|
title | Greeting |
length | 256 |
-
The
POST_JSON_DOC_JSON_OBJ_posts_JSON_ARRAY_0_HASH_title_value
point refers to theGreeting
value that corresponds with thetitle
key from the JSON objects hash table addressed by the Hash filter. -
The
POST_JSON_DOC_JSON_OBJ_posts_JSON_ARRAY_0_HASH_length_value
point refers to the256
value that corresponds with thelength
key from the JSON objects hash table addressed by the Hash filter.