DataScript: avi.http.get_path_tokens
DataScript
Function | avi.http.get_path_tokens( [start [, end]] ) |
Description | Retrieve individual path sections, or tokens, from the URI’s path (aka strings separated by the delimiter ‘/’). The command provides the flexibility to get a slice of path tokens (see examples below) when start and/or end indices are provided. |
Events | HTTP_REQ HTTP_RESP |
Parameter | start and end indices allow parsing out section of the path. These parameters are expressed as an integer. |
Returns | If no start and end indices are specified, returns a Lua table of all the path tokens. If either start index is specified or both start and end indices are specified, returns a string. |
Example | Example: https://www.avinetworks.com/a/b/c/d/e.htm Returns a table which is an array with values ‘a’, ‘b’, ‘c’, ‘d’, ‘e.htm’. All tokens are returned.
Returns ‘a/b/c/d/e.htm’
Returns ‘c/d/e.htm’
Returns ‘b/c’
Returns ‘nil’
|
Note: This API is not supported in the events SSL_PRECONNECT
, SSL_CLIENTHELLO
, and SSL_HANDSHAKE_DONE
.