Os_http_request::host($value), Return values, Example – Brocade Virtual ADX OpenScript API Guide (Supporting ADX v03.1.00) User Manual
Page 61: Context, Usage, Input parameters

Brocade Virtual ADX OpenScript API Guide
49
53-1003243-01
Methods
5
Return Values
The following table contains the return values.
Example
OS_HTTP_REQUEST::host($value)
Sets the value of the host to the value specified in $value.
Context
HTTP request event. If called in the HTTP response context, undefined will be returned.
Usage
Can be used to rewrite the host header.
Input Parameters
The following table contains the input values.
Return Values
None
Example
TABLE 45
Return Values
Name
Type
Description
string
value of the host. If not present,
undefined is returned.
TABLE 46
Input Values
Name
Type
Description
$value
string
A string representing the value
of the host.
use OS_HTTP_REQUEST;
use OS_SLB;
sub HTTP_REQUEST{
my $host = OS_HTTP_REQUEST::host;
if (defined $host && $host eq "www.brocade.com" ) {
OS_SLB::forward(1);
}
}
use OS_HTTP_REQUEST;
sub HTTP_REQUEST{
OS_HTTP_REQUEST::host("www.brocade.com");
}