beautypg.com

Os_http_request::query($val), Example, Context – Brocade Virtual ADX OpenScript API Guide (Supporting ADX v03.1.00) User Manual

Page 55: Usage, Input parameters, Return values

background image

Brocade Virtual ADX OpenScript API Guide

43

53-1003243-01

Methods

5

Example

OS_HTTP_REQUEST::query($val)

Sets the value of the URL query 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 a url query.

Input Parameters

The following table contains the input values.

Return Values

None

Example

TABLE 36

Input Values

Name

Type

Description

$val

string

A string representing the value
of the url. query

use OS_SLB;

use OS_HTTP_REQUEST;

sub HTTP_REQUEST{

my $query = OS_HTTP_REQUEST::query;

my $method = OS_HTTP_REQUEST::method;

if ( defined $querry && $query eq "search=sometext") {

OS_SLB::forward(1);

} elsif ( defined $query && query eq "search=othertext") {

OS_SLB::forward(2);

}

}

use OS_SLB;

use OS_HTTP_REQUEST;

sub HTTP_REQUEST() {

OS_HTTP_REQUEST::query("myname=search");

OS_SLB::forward(1);

}