Os_http_request::version($val), Usage, Input parameters – Brocade Virtual ADX OpenScript API Guide (Supporting ADX v03.1.00) User Manual

Page 57: Return values, Example, Context

Advertising
background image

Brocade Virtual ADX OpenScript API Guide

45

53-1003243-01

Methods

5

Usage

Can be used to perform load-balancing based on the version.

Input Parameters

None.

Return Values

The following table contains the return values.

Example

OS_HTTP_REQUEST::version($val)

Sets the value of the version to the value specified in $val.

Context

HTTP request event. If called in the HTTP response context, undefined will be returned.

Usage

Can be used to rewrite version.

Input Parameters

The following table contains the input values.

TABLE 38

Return Values

Name

Type

Description

string

Value of the request version. If
not present, undefined is
returned.

TABLE 39

Input Values

Name

Type

Description

$val

string

A string representing the value
of the version.

use OS_HTTP_REQUEST;

use OS_SLB;

sub HTTP_REQUEST{

my $version = OS_HTTP_REQUEST::version;

my $method = OS_HTTP_REQUEST::method;

if ( defined $version && $version eq "1.0" ) {

OS_SLB::forward(1);

} elsif ( defined $method && $method eq "GET" ) {

OS_SLB::forward(2);

}

Advertising