RequestLimitsElement Class [IIS 7 and higher]

Specifies size limits on incoming HTTP requests.

Syntax

class RequestLimitsElement : EmbeddedObject

Methods

This class contains no methods.

Properties

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

Name

Description

HeaderLimits

A HeaderLimitsSettings value that specifies HTTP header sizes.

MaxAllowedContentLength

A read/write uint32 value that specifies the maximum length, in bytes, of content in a request. The default is 30000000 (approximately 30 megabytes.)

MaxQueryString

A read/write uint32 value that specifies the maximum length, in bytes, of the query string. The default is 2048.

MaxUrl

A read/write uint32 value that specifies the maximum length, in bytes, of the request URL. The default is 260.

Subclasses

This class contains no subclasses.

Remarks

Instances of this class are contained in the RequestLimits array property of the RequestFilteringSection class.

This class integrates into IIS 7 the RequestLimits settings of the URLScan tool used by previous versions of IIS.

Note

You must install the Request Filtering Module (Modrqflt.dll) for the settings in this class to 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=''")

' Set a variable to the RequestFilteringSection.RequestLimits property,
' which contains an array of RequestLimitsElement objects.
Set oRequestLimitsElement = oRequestFilteringSection.RequestLimits

' Display the path and list the non-array RequestLimitsElement properties.
WScript.Echo "[Request Limits]"
WScript.Echo "Path: " & oRequestFilteringSection.Path 
WScript.Echo "maxAllowedContentLength: " & _
    oRequestLimitsElement.maxAllowedContentLength
WScript.Echo "maxUrl: " & oRequestLimitsElement.maxUrl
WScript.Echo "maxQueryString: " & oRequestLimitsElement.maxQueryString
WScript.Echo 

' List the contents of the RequestLimitsElement.HeaderLimits.HeaderLimits
' property, which contains an array of HeaderLimitsElement instances.
WScript.Echo vbtab & "[Header Limits]"
For Each oHeaderLimit In oRequestLimitsElement.HeaderLimits.HeaderLimits
    WScript.Echo vbtab & "Header: " & oHeaderLimit.Header
    WScript.Echo vbtab & "Header size limit: " & oHeaderLimit.sizeLimit
    WScript.Echo 
Next

Inheritance Hierarchy

EmbeddedObject

   RequestLimitsElement

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

EmbeddedObject Class [IIS 7 and higher]

FileExtensionsSettings Class [IIS 7 and higher]

HeaderLimitsElement Class [IIS 7 and higher]

HeaderLimitsSettings Class [IIS 7 and higher]

RequestFilteringSection Class [IIS 7 and higher]

requestLimits Element for requestFiltering [IIS Settings Schema]

VerbsSettings Class [IIS 7 and higher]