HeaderLimitsElement Class [IIS 7 and higher]

Specifies the permitted sizes of HTTP request headers.

Syntax

class HeaderLimitsElement : CollectionElement

Methods

This class contains no methods.

Properties

The following table lists the properties exposed by the HeaderLimitsElement class.

Name

Description

Header

A required unique read/write string value that specifies an HTTP request header. The default is a null reference. The key property.

SizeLimit

A required uint32 value that specifies, in bytes, the maximum length of the HTTP request header specified in the Header property.

Subclasses

This class contains no subclasses.

Remarks

Instances of this class are contained in the HeaderLimits array property of the HeaderLimitsSettings class.

This class corresponds to the <headerLimits> element in the <requestLimits> section of the ApplicationHost.config file.

Note

You must install the Request Filtering Module (Modrqflt.dll) before the configuration settings in this class can take effect.

Example

The following example displays all the properties of the RequestLimitsElement class.

' Connect to the WMI WebAdministration namespace.
Set objWMIService = GetObject("winmgmts:root\WebAdministration")

' Get the RequestFilteringSection.
Set oRequestFilteringSection = objWMIService.Get( _
"RequestFilteringSection.Path='MACHINE/WEBROOT/APPHOST',Location=''")

' Display the path and the contents of the 
' RequestFilteringSection.RequestLimits.HeaderLimits.HeaderLimits 
' property, which contains an array of HeaderLimitsElement instances.
WScript.Echo "[Header Limits]"
WScript.Echo "Path: " & oRequestFilteringSection.Path
WScript.Echo 
For Each oHeaderLimit In oRequestFilteringSection.RequestLimits.HeaderLimits.HeaderLimits
    WScript.Echo "Header: " & oHeaderLimit.Header
    WScript.Echo "Header size limit: " & oHeaderLimit.sizeLimit
    WScript.Echo 
Next

Inheritance Hierarchy

CollectionElement

   HeaderLimitsElement

Requirements

Type

Description

Client

Requires IIS 7 on Windows Vista.

Server

Requires IIS 7 on Windows Server 2008.

Product

IIS 7

MOF file

WebAdministration.mof

See Also

Reference

CollectionElement Class [IIS 7 and higher]

HeaderLimitsSettings Class [IIS 7 and higher]

RequestFilteringSection Class [IIS 7 and higher]

RequestLimitsElement Class [IIS 7 and higher]