beautypg.com

Os_http_response::content, Context, Usage – Brocade Virtual ADX OpenScript API Guide (Supporting ADX v03.1.00) User Manual

Page 81: Input parameters, Return values, Example

background image

Brocade Virtual ADX OpenScript API Guide

69

53-1003243-01

Methods

6

Context

This function can be called from an HTTP_RESPONSE_DATA event.

Usage

This function is useful only for HTTP responses with a payload component.

Input Parameters

The following table contains the input values.

Return Values

None

Example

OS_HTTP_RESPONSE::content

Returns the response content specified in the HTTP response if it exists otherwise it will return
undefined.

The size of content returned can be:

1. Larger than specified in the collect call if more data is available when the content is called.

2. Smaller than specified in the collect call if the actual complete body is smaller.

The previous content will be returned every time the content is called unless the script has explicitly
changed content or sent data out.

Context

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

TABLE 71

Input Values

Name

Type

Description

1

Collects the whole body of the response requested.

integer

Specifies the minimum number of bytes of the response body data to
be collected.

none

Collects response body data per packet.

use OS_SLB;

use OS_HTTP_RESPONSE;

sub HTTP_RESPONSE{

OS_HTTP_RESPONSE::collect(1);

}

sub HTTP_RESPONSE_DATA {

my $content = OS_HTTP_RESPONSE::content;

OS_SLB::send_to_client;

}