192 Citrix NetScaler Policy Configuration and Reference Guide

The following is the basic syntax for an HTTP callout policy. Note that in the following syntax, line breaks have been added for readability. You specify the command parameters without entering a line break:

set policy httpCallout calloutName

{

-IPAddress[ipAddressipv6Address*] -port[port*] -vServervirtualServerName]

}

-returnType BOOLNUMTEXT

{

[-httpMethod(GETPOST) -hostExprstring or expression

-urlStemExprstring or expression -headers Name(value) ...

-parameters Name(value) ...] [-fullReqExpr string]

}

-resultExpr string

For parameter descriptions, see the table, “Elements in an HTTP Callout Policy,” on page 188:

Examples

add policy httpCallout myCallout

set httpCallout myCallout -ipaddress 10.101.10.10 -port 80

-returnType text -httpMethod GET -hostExpr "'/10.101.10.11/'"

-urlStemExpr "'/mysite/index.html/'" -parameters name("My Name") -resultExpr http.res.header("Hostname")

add policy httpCallout myCallout2

set httpCallout myCallout2 -vserver my_HTTP_LB_vserver -returnType num -httpMethod GET -hostExpr 'http.req.header("Host")' -urlStemExpr "http.req.url" -parameters Name("My Name") -headers Name("MyHeader") -resultExpr "http.res.body(10000).length"

add policy httpCallout fullReqCallout

set policy httpCallout fullReqCallout -vserver my_HTTP_LB_vserver -returnType num -httpMethod GET -fullReqExpr q{"GET " + http.req. url + " HTTP/" + http.req.version.major + "." + http.req.version. minor.sub(1) + "r\nHost: 10.101.10.10\r\nAccept: */*\r\n\r\n"}

To modify a callout policy using the NetScaler command line

At a NetScaler command prompt, type:

unset httpCallout calloutName -argument

Where:

Page 206
Image 206
Citrix Systems 9.2 manual Examples, To modify a callout policy using the NetScaler command line