114 Citrix NetScaler Policy Configuration and Reference Guide

About Evaluating HTTP and TCP Payload

The payload of an HTTP request or response consists of header fields, URLs, the body content, the version, status, and so on. For example, the following expression performs a simple matching operation on an HTTP request to determine if it contains a header named “myHeader”:

http.req.header("myHeader").exists

The following example compound expression evaluates HTTP headers. You could use the following expression in various NetScaler features, such as Integrated Caching, Rewrite, and Responder:

(http.req.header("Content-Type").exists && http.req. header("Content-Type").eq("text/html")) (http.req. header("Transfer-Encoding").exists) (http.req. header("Content-Length").exists)

The payload of a TCP or UDP packet is the data portion of the packet. You can configure advanced expressions to examine features of a TCP or UDP packet, including the following:

Source and destination domains

Source and destination ports

The text in the payload

Record types

About Evaluating the Payload Body

There are three expression prefixes that extract text from the body of the payload, as follows:

HTTP.REQ.BODY(integer). Returns the body of an HTTP request as a multiline text object, up to the character position designated in the integer argument. If there are fewer characters in the body than is specified in the argument, the entire body is returned.

HTTP.RES.BODY(integer). Returns a portion of the HTTP response body. The length of the returned text is equal to the number in the integer argument. If there are fewer characters in the body than is specified in integer, the entire body is returned.

CLIENT.TCP.PAYLOAD(integer). Returns TCP payload data as a string, starting with the first character in the payload and continuing for the number of characters in the integer argument.

Page 128
Image 128
Citrix Systems 9.2 manual About Evaluating Http and TCP Payload, About Evaluating the Payload Body