Os_http_response::remove_header ($name), Os_http_response::remove_all_headers($name), Example – Brocade Virtual ADX OpenScript API Guide (Supporting ADX v03.1.00) User Manual

Page 84: Context, Usage, Input parameters, Return values

Advertising
background image

72

Brocade Virtual ADX OpenScript API Guide

53-1003243-01

Methods

6

Example

OS_HTTP_RESPONSE::remove_header ($name)

Removes the HTTP header specified in $name. If no header is present, this function will have no
effect.

NOTE

This API will remove a header with a value specified for the $name variable (case insensitive). For
example, OS_HTTP_RESPONSE::remove_header("X-Forwarded-For") will ONLY remove the first
occurrence of the header by that name (case insensitive).

Context

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

Usage

Can be used to remove a header.

Input Parameters

The following table contains the input values.

Return Values

None

Example

OS_HTTP_RESPONSE::remove_all_headers($name)

Removes all HTTP headers with the same specified names. If such a header is not present, this
function will have no effect.

TABLE 75

Input Values

Name

Type

Description

$name

string

A string representing the HTTP
header name.

use OS_HTTP_RESPONSE;

sub HTTP_RESPONSE{

OS_HTTP_RESPONSE::push_header("my-header", "my header value");

}

use OS_HTTP_RESPONSE;

sub HTTP_REQUEST{

OS_HTTP_RESPONSE::remove_header("my-header");

}

Advertising