Export (0) Print
Expand All

HttpRequestBase Class

Serves as the base class for classes that enable ASP.NET to read the HTTP values sent by a client during a Web request.

Namespace:  System.Web
Assembly:  System.Web (in System.Web.dll)

public abstract class HttpRequestBase

The HttpRequestBase type exposes the following members.

  NameDescription
Protected methodHttpRequestBaseInitializes the class for use by an inherited class instance. This constructor can only be called by an inherited class.
Top

  NameDescription
Public propertyAcceptTypesWhen overridden in a derived class, gets an array of client-supported MIME accept types.
Public propertyAnonymousIDWhen overridden in a derived class, gets the anonymous identifier for the user, if it is available.
Public propertyApplicationPathWhen overridden in a derived class, gets the virtual root path of the ASP.NET application on the server.
Public propertyAppRelativeCurrentExecutionFilePathWhen overridden in a derived class, gets the virtual path of the application root and makes it relative by using the tilde (~) notation for the application root (as in "~/page.aspx").
Public propertyBrowserWhen overridden in a derived class, gets information about the requesting client's browser capabilities.
Public propertyClientCertificateWhen overridden in a derived class, gets the current request's client security certificate.
Public propertyContentEncodingWhen overridden in a derived class, gets or sets the character set of the data that is provided by the client.
Public propertyContentLengthWhen overridden in a derived class, gets the length, in bytes, of content that was sent by the client.
Public propertyContentTypeWhen overridden in a derived class, gets or sets the MIME content type of the request.
Public propertyCookiesWhen overridden in a derived class, gets the collection of cookies that were sent by the client.
Public propertyCurrentExecutionFilePathWhen overridden in a derived class, gets the virtual path of the current request.
Public propertyCurrentExecutionFilePathExtensionWhen implemented in a derived class, gets the extension of the file name that is specified in the CurrentExecutionFilePath property.
Public propertyFilePathWhen overridden in a derived class, gets the virtual path of the current request.
Public propertyFilesWhen overridden in a derived class, gets the collection of files that were uploaded by the client, in multipart MIME format.
Public propertyFilterWhen overridden in a derived class, gets or sets the filter to use when the current input stream is being read.
Public propertyFormWhen overridden in a derived class, gets the collection of form variables that were sent by the client.
Public propertyHeadersWhen overridden in a derived class, gets the collection of HTTP headers that were sent by the client.
Public propertyHttpChannelBindingWhen overridden in a derived class, gets the ChannelBinding object of the current HttpWorkerRequest instance.
Public propertyHttpMethodWhen overridden in a derived class, gets the HTTP data-transfer method (such as GET, POST, or HEAD) that was used by the client.
Public propertyInputStreamWhen overridden in a derived class, gets the contents of the incoming HTTP entity body.
Public propertyIsAuthenticatedWhen overridden in a derived class, gets a value that indicates whether the request has been authenticated.
Public propertyIsLocalWhen overridden in a derived class, gets a value that indicates whether the request is from the local computer.
Public propertyIsSecureConnectionWhen overridden in a derived class, gets a value that indicates whether the HTTP connection uses secure sockets (HTTPS protocol).
Public propertyItemWhen overridden in a derived class, gets the specified object from the Cookies, Form, QueryString, or ServerVariables collections.
Public propertyLogonUserIdentityWhen overridden in a derived class, gets the WindowsIdentity type for the current user.
Public propertyParamsWhen overridden in a derived class, gets a combined collection of QueryString, Form, ServerVariables, and Cookies items.
Public propertyPathWhen overridden in a derived class, gets the virtual path of the current request.
Public propertyPathInfoWhen overridden in a derived class, gets additional path information for a resource that has a URL extension.
Public propertyPhysicalApplicationPathWhen overridden in a derived class, gets the physical file-system path of the current application's root directory.
Public propertyPhysicalPathWhen overridden in a derived class, gets the physical file-system path of the requested resource.
Public propertyQueryStringWhen overridden in a derived class, gets the collection of HTTP query-string variables.
Public propertyRawUrlWhen overridden in a derived class, gets the complete URL of the current request.
Public propertyReadEntityBodyModeWhen implemented in a derived class, gets a value that indicates whether the request entity body has been read, and if so, how it was read.
Public propertyRequestContextWhen overridden in a derived class, gets the RequestContext instance of the current request.
Public propertyRequestTypeWhen overridden in a derived class, gets or sets the HTTP data-transfer method (GET or POST) that was used by the client.
Public propertyServerVariablesWhen overridden in a derived class, gets a collection of Web server variables.
Public propertyTimedOutTokenWhen implemented in a derived class, gets a CancellationToken object that is tripped when a request times out.
Public propertyTotalBytesWhen overridden in a derived class, gets the number of bytes in the current input stream.
Public propertyUnvalidatedWhen implemented in a derived class, provides access to HTTP request values without triggering request validation.
Public propertyUrlWhen overridden in a derived class, gets information about the URL of the current request.
Public propertyUrlReferrerWhen overridden in a derived class, gets information about the URL of the client request that linked to the current URL.
Public propertyUserAgentWhen overridden in a derived class, gets the complete user-agent string of the client.
Public propertyUserHostAddressWhen overridden in a derived class, gets the IP host address of the client.
Public propertyUserHostNameWhen overridden in a derived class, gets the DNS name of the client.
Public propertyUserLanguagesWhen overridden in a derived class, gets a sorted array of client language preferences.
Top

  NameDescription
Public methodAbortForcibly terminates the underlying TCP connection, causing any outstanding I/O to fail.
Public methodBinaryReadWhen overridden in a derived class, performs a binary read of a specified number of bytes from the current input stream.
Public methodEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetBufferedInputStreamWhen implemented in a derived class, gets a Stream object that can be used to read the incoming HTTP entity body.
Public methodGetBufferlessInputStream()When implemented in a derived class, gets a Stream object that can be used to read the incoming HTTP entity body, optionally disabling the request length limit that is set in the MaxRequestLength property.
Public methodGetBufferlessInputStream(Boolean)When implemented in a derived class, gets a Stream object that can be used to read the incoming HTTP entity body, optionally disabling the request length limit that is set in the MaxRequestLength property.
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodInsertEntityBody()When implemented in a derived class, provides a copy of the HTTP request entity body to IIS.
Public methodInsertEntityBody(Byte[], Int32, Int32)When implemented in a derived class, provides IIS with a copy of the HTTP request entity body and with information about the request entity object.
Public methodMapImageCoordinatesWhen overridden in a derived class, maps an incoming image-field form parameter to appropriate x-coordinate and y-coordinate values.
Public methodMapPath(String)When overridden in a derived class, maps the specified virtual path to a physical path on the server.
Public methodMapPath(String, String, Boolean)When overridden in a derived class, maps the specified virtual path to a physical path on the server.
Public methodMapRawImageCoordinatesMaps an incoming image field form parameter into appropriate x and y coordinate values.
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodSaveAsWhen overridden in a derived class, saves an HTTP request to disk.
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Public methodValidateInputWhen overridden in a derived class, causes validation to occur for the collections that are accessed through the Cookies, Form, and QueryString properties.
Top

The HttpRequestBase class is an abstract class that contains the same members as the HttpRequest class. The HttpRequestBase class enables you to create derived classes that are like the HttpRequest class, but that you can customize and that work outside the ASP.NET pipeline. When you perform unit testing, you typically use a derived class to implement members that have customized behavior that fulfills the scenario that you are testing.

The HttpRequestWrapper class derives from the HttpRequestBase class. The HttpRequestWrapper class serves as a wrapper for the HttpRequest class. At run time, you typically use an instance of the HttpRequestWrapper class to invoke members of the HttpRequest object.

.NET Framework

Supported in: 4.5.3, 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show:
© 2014 Microsoft