DataScript: avi.http.get_query
DataScript
Function | avi.http.get_query( [arg_name | avi.QUERY_TABLE] [, decode] ) |
Description | Returns the query from the URI, or an individual query value. The highlighted portion of the request is included in the query: |
Events | HTTP_REQ HTTP_RESP |
Parameter | When no parameter is specified, the full query is returned. If an arg_name is specified, and if that argument is present in the query, then its value is returned. When the flag avi.QUERY_TABLE is specified, a table is returned with all the arguments.
By default, the query is returned as URI decoded. For instance, ‘/’ rather than %2F. The decode parameter will URI decode the returned value. Default value of decode parameter is true. By providing the decode parameter as false, the query returns non-decoded URI. Note: The decode parameter does not have an effect if the format arg provided is avi.QUERY_TABLE. |
Returns | A string for the returned query, an individual argument and value, or a table holding all arguments and values where the argument names are the keys. |
Example 1 |
|
Example 2 | Return all URI query arguments to the client via local response page.
For request: https://demo.avinetworks.com/path1/index.html?a=b&c=&d=eThe following is returned: a:b, d:e, c:, |
Note: This API is not supported in the events SSL_PRECONNECT
, SSL_CLIENTHELLO
, and SSL_HANDSHAKE_DONE
.