Chapter 9 Advanced Expressions: String Sets, String Patterns, and Data Formats 175

Typecasting Operations

Operation

Description

 

 

text.TYPECAST_HTTP_

Converts the designated text to a multi-line HTTP header

HEADER_T("name")

that you specify in a name argument.

 

For example, the following expression converts

 

“MyHeader” to “InHeader”:

 

http.req.header("MyHeader").typcast_http_

 

header_t("InHeader")

 

Typically, text operations that you specify in this type of

 

expression apply to only the last line of this header, with

 

some exceptions. For example, the CONTAINS operation

 

operates on values in all the lines in instances of this header

 

type.

text.TYPCAST_COOKIE_

Treats the designated text as an HTTP cookie as it appears in

T

a Set-Cookie or Set-Cookie2 header. You can apply name-

 

value list operations as well as text operations to the

 

designated text. For example, you can designate an equals (=

 

) as the name-value delimiter and the semicolon (;) as the list

 

element delimiter.

 

If you apply name-value list operations, note that the list is

 

parsed as if IGNORE_EMPTY_ELEMENTS were in effect.

 

Each cookie begins with a cookie-name=cookie-valuepair,

 

optionally followed by attribute-value pairs that are

 

separated by a semicolon, as follows:

 

cookie1=value1;version=n.n;value;domain=

 

value;path=value

 

If the same attribute appears more than once in a cookie, the

 

value for the first instance of the attribute is returned.

 

 

number.TYPECAST_

Transforms the number to a value of data type “double”.

DOUBLE_AT

 

number.TYPECAST_IP_

Converts the number to an IP address.

ADDRESS_AT

 

number.TYPECAST_

Converts the number to time format.

TIME_AT

 

Page 189
Image 189
Citrix Systems 9.2 Converts the designated text to a multi-line Http header, That you specify in a name argument, Type