beautypg.com

Http request api reference, Overview, Limitation of the content rewrite – Brocade Virtual ADX OpenScript API Guide (Supporting ADX v03.1.00) User Manual

Page 49: Methods, Os_http_request::method, Chapter 5

background image

Brocade Virtual ADX OpenScript API Guide

37

53-1003243-01

Chapter

5

HTTP REQUEST API reference

In this chapter

This chapter contains the following sections:

Overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

Overview

The OS_HTTP_REQUEST module includes the APIs to retrieve or set the value of the fields in the
current HTTP request headers. These APIs can only be called from the HTTP_REQUEST event.

The use statement needs to be in the declaration block of the script for methods of that
package to be used.

For example: to use the OS_HTTP_REQUEST methods, The OS_HTTP_REQUEST package must be
declared as follows:

use OS_HTTP_REQUEST;

Limitation of the content rewrite

The maximum number of the HTTP header rewrite entries is 19. If there is a pattern to be deleted
that spans multiple packets (i.e. two packets), it will be considered as two rewrite actions. When
the total number of rewrites exceed 19, the TCP connection may fail or the content rewrite action
exceeding the limit may fail. The maximum header rewrite entry size cannot exceed the TCP MSS
(Maximum Segment Size).

Also for header insertion, the maximum length of a header name is 128 bytes and the maximum
length of a header value is 512 bytes. When combined together the sum of the header name and
header values cannot exceed 512 bytes.

Methods

OS_HTTP_REQUEST::method

Returns method type specified in HTTP request header if it exists, otherwise it will return NULL.

Context

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