HTTP Parser¶
The implicit HTTP parser performs the annual request processing. Its name should not be specified in a point upon using filters provided by it.
The HTTP parser builds a complex data structure on the basis of the baseline request. You can use the following filters to address the elements of this data structure:
Using filters in points
Add the name of the filter in upper case to the point to use the filter in the point.
URI Filter¶
The URI filter refers to the absolute path to the request target. The absolute path starts with the /
symbol that follows the domain or the IP address of the target.
The URI filter refers to a string value. This filter cannot refer to complex data structures (such as arrays or hash tables).
Example:
The URI_value
point refers to the /login/index.php
string in the GET http://example.com/login/index.php
request.
Path Filter¶
The Path filter refers to an array containing URI path parts. The elements of this array need to be referred to by using their indexes. The array indexing starts with 0
.
Regular expressions in points
The index in the point can be a regular expression of the Ruby programming language.
Example:
For the GET http://example.com/main/login/index.php HTTP/1.1
request, the Path filter refers to the following array:
Index | Value |
---|---|
0 | main |
1 | login |
-
The
PATH_0_value
point refers to themain
value that is located in the array addressed by the Path filter with the0
index. -
The
PATH_1_value
point refers to thelogin
value that is located in the array addressed by the Path filter with the1
index.
If the request URI contains only one part, the Path filter addresses the empty array.
Example:
For the GET http://example.com/ HTTP/1.1
request, the Path filter refers to an empty array.
Action_name Filter¶
The Action_name filter refers to the part of the URI that starts after the last /
symbol and ends with the period.
The Action_name filter refers to a string value. This filter cannot refer to complex data structures (such as arrays or hash tables).
Example:
-
The
ACTION_NAME_value
point refers to theindex
value for theGET http://example.com/login/index.php
request. -
The
ACTION_NAME_value
point refers to the empty value for theGET http://example.com/login/
request.
Action_ext Filter¶
The Action_ext filter refers to the part of the URI that starts after the first period following the last /
symbol. If this part of the URI is missing from the request, the Action_ext filter cannot be used in the point.
The Action_ext filter refers to a string value. This filter cannot refer to complex data structures (such as arrays or hash tables).
Example:
-
The
ACTION_EXT_value
point refers to thephp
value for theGET http://example.com/main/login/index.php
request. -
The Action_ext filter cannot be used in the point that refers the
GET http://example.com/main/login/
request.
Get Filter¶
The Get filter refers to the hash table that contains parameters from the request query string. The elements of this hash table need to be referred to by using the names of the parameters.
Regular expressions in points
The name of the parameter in the point can be a regular expression of the Ruby programming language.
Query string parameters may also contain the following complex data structures: arrays and hash tables. Use the Array and Hash filters correspondingly to address the elements in these structures.
Example:
For the POST http://example.com/login?id=01234&username=admin
request, the Get filter refers to the following hash table:
Parameter name | Value |
---|---|
id | 01234 |
username | admin |
-
The
GET_id_value
point refers to the01234
value that corresponds to theid
parameter from the hash table addressed by the Get filter. -
The
GET_username_value
point refers to theadmin
value that corresponds to theusername
parameter from the hash table addressed by the Get filter.
Header Filter¶
The Header filter refers to the hash table that contains header names and values. The elements of this hash table need to be referred to by using the names of the headers.
A header name in a point
A header name can be specified in a point in one of the following ways:
- In upper case
- The same way it is specified in the request
Regular expressions in points
The header name in the point can be a regular expression of the Ruby programming language.
The name of the header can also contain an array of values. Use the Array filter to address the elements of this array.
Example:
For the
request, the Header filter refers to the following hash table:
Header name | Value |
---|---|
Connection | keep-alive |
Host | example.com |
Accept-Encoding | gzip |
-
The
HEADER_Connection_value
point refers to thekeep-alive
value that corresponds to theConnection
header from the hash table addressed by the Header filter. -
The
HEADER_Host_value
point refers to theexample.com
value that corresponds to theHost
header from the hash table addressed by the Header filter. -
The
HEADER_Accept-Encoding_value
point refers to thegzip
value that corresponds to theAccept-Encoding
header from the hash table addressed by the Header filter.
Post Filter¶
The Post filter refers to the request body contents.
You can use the name of the Post filter in the point to work with the request body contents in raw format.
Example:
For the
request with the
body, the POST_value
point refers to the This is a simple body text.
value from the request body.
You can also work with a request body that contains complex data structures. Use the following filters and parsers in the point after the Post filter to address the elements of the corresponding data structures:
-
The Form_urlencoded parser for the request body in the form-urlencoded format
-
The Multipart parser for the request body in the multipart format
-
The filters that are provided by the XML parser for the request body in the XML format
-
The filters that are provided by the Json_doc parser for the request body in the JSON format