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 [ipAddress|ipv6Address|*] -port [port|*] |
-vServer virtualServerName]
}
-returnType BOOL|NUM|TEXT
{
[-httpMethod (GET|POST)
-hostExpr string or expression
-urlStemExpr string 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: