beautypg.com

Os_http_response::push_header ($name, $val), Return values, Performance impact – Brocade Virtual ADX OpenScript API Guide (Supporting ADX v03.1.00) User Manual

Page 83: Example, Context, Usage, Input parameters

background image

Brocade Virtual ADX OpenScript API Guide

71

53-1003243-01

Methods

6

Return Values

None

Performance impact

Using this function will have a significant impact on system performance.

Example

OS_HTTP_RESPONSE::push_header ($name, $val)

Inserts the HTTP header specified in $name and $val, even if an existing header with $name is
present.

Context

This function called in http request context will have no effect.

Usage

Can be used to insert a header.

Input Parameters

The following table contains the input values.

Return Values

None

TABLE 74

Input Values

Name

Type

Description

$name

string

A string representing the HTTP
header name.

$val

string

A string representing the HTTP
header value.

use OS_SLB;

use OS_HTTP_RESPONSE;

sub HTTP_RESPONSE{

OS_HTTP_RESPONSE::collect();

}

sub HTTP_RESPONSE_DATA {

my $content = OS_HTTP_RESPONSE::content;

$content =~ s/testing/tests for fun/g;

OS_HTTP_RESPONSE::content($content);

OS_SLB::send_to_client;

}