Os_http_request::url_extension, Os_http_request::version, Context – Brocade Virtual ADX OpenScript API Guide (Supporting ADX v03.1.00) User Manual
Page 56: Usage, Input parameters, Return values, Example
44
Brocade Virtual ADX OpenScript API Guide
53-1003243-01
Methods
5
OS_HTTP_REQUEST::url_extension
Returns URL extension specified in the HTTP request header if it exists, otherwise it will return
NULL.
Context
HTTP request event. If called in the HTTP response context, undefined will be returned.
Usage
Can be used to perform load-balancing based on a url extension.
Input Parameters
None.
Return Values
The following table contains the return values.
Example
OS_HTTP_REQUEST::version
Returns request version specified in the HTTP request header if it exists, otherwise it will return
NULL.
Context
HTTP request event. If called in the HTTP response context, undefined will be returned.
TABLE 37
Return Values
Name
Type
Description
string
Value of the URL extension. If
not present, undefined is
returned.
use OS_HTTP_REQUEST;
use OS_SLB;
sub HTTP_REQUEST{
$ext = OS_HTTP_REQUEST::url_extension;
if($ext eq "jpg")
{
OS_SLB::forward(1);
} else {
OS_SLB::forward(2);
}
}