This topic has not yet been rated - Rate this topic

HttpRequestWrapper Class

Encapsulates the HTTP intrinsic object that enables ASP.NET to read the HTTP values that are sent by a client during a Web request.

System.Object
  System.Web.HttpRequestBase
    System.Web.HttpRequestWrapper

Namespace:  System.Web
Assembly:  System.Web (in System.Web.dll)
public class HttpRequestWrapper : HttpRequestBase

The HttpRequestWrapper type exposes the following members.

  Name Description
Public method HttpRequestWrapper Initializes a new instance of the HttpRequestWrapper class by using the specified request object.
Top
  Name Description
Public property AcceptTypes Gets an array of client-supported MIME accept types. (Overrides HttpRequestBase.AcceptTypes.)
Public property AnonymousID Gets the anonymous identifier for the user, if it is available. (Overrides HttpRequestBase.AnonymousID.)
Public property ApplicationPath Gets the virtual path of the root of the ASP.NET application on the server. (Overrides HttpRequestBase.ApplicationPath.)
Public property AppRelativeCurrentExecutionFilePath 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"). (Overrides HttpRequestBase.AppRelativeCurrentExecutionFilePath.)
Public property Browser Gets information about the requesting client's browser capabilities. (Overrides HttpRequestBase.Browser.)
Public property ClientCertificate Gets the current request's client security certificate. (Overrides HttpRequestBase.ClientCertificate.)
Public property ContentEncoding Gets or sets the character set of the data that was provided by the client. (Overrides HttpRequestBase.ContentEncoding.)
Public property ContentLength Gets the length, in bytes, of content that was sent by the client. (Overrides HttpRequestBase.ContentLength.)
Public property ContentType Gets or sets the MIME content type of the request. (Overrides HttpRequestBase.ContentType.)
Public property Cookies Gets the collection of cookies that were sent by the client. (Overrides HttpRequestBase.Cookies.)
Public property CurrentExecutionFilePath Gets the virtual path of the current request. (Overrides HttpRequestBase.CurrentExecutionFilePath.)
Public property FilePath Gets the virtual path of the current request. (Overrides HttpRequestBase.FilePath.)
Public property Files Gets the collection of files that were uploaded by the client, in multipart MIME format. (Overrides HttpRequestBase.Files.)
Public property Filter Gets or sets the filter to use when the current input stream is being read. (Overrides HttpRequestBase.Filter.)
Public property Form Gets the collection of form variables that were sent by the client. (Overrides HttpRequestBase.Form.)
Public property Headers Gets the collection of HTTP headers that were sent by the client. (Overrides HttpRequestBase.Headers.)
Public property HttpChannelBinding Gets the ChannelBinding object of the current HttpWorkerRequest instance. (Overrides HttpRequestBase.HttpChannelBinding.)
Public property HttpMethod Gets the HTTP data-transfer method (such as GET, POST, or HEAD) that was used by the client. (Overrides HttpRequestBase.HttpMethod.)
Public property InputStream Gets the contents of the incoming HTTP entity body. (Overrides HttpRequestBase.InputStream.)
Public property IsAuthenticated Gets a value that indicates whether the request has been authenticated. (Overrides HttpRequestBase.IsAuthenticated.)
Public property IsLocal Gets a value that indicates whether the request is from the local computer. (Overrides HttpRequestBase.IsLocal.)
Public property IsSecureConnection Gets a value that indicates whether the HTTP connection uses secure sockets (HTTPS protocol). (Overrides HttpRequestBase.IsSecureConnection.)
Public property Item Gets the specified object from the Cookies, Form, QueryString, or ServerVariables collections. (Overrides HttpRequestBase.Item[String].)
Public property LogonUserIdentity Gets the WindowsIdentity type for the current user. (Overrides HttpRequestBase.LogonUserIdentity.)
Public property Params Gets a combined collection of QueryString, Form, ServerVariables, and Cookies items. (Overrides HttpRequestBase.Params.)
Public property Path Gets the virtual path of the current request. (Overrides HttpRequestBase.Path.)
Public property PathInfo Gets additional path information for a resource that has a URL extension. (Overrides HttpRequestBase.PathInfo.)
Public property PhysicalApplicationPath Gets the physical file-system path of the current application's root directory. (Overrides HttpRequestBase.PhysicalApplicationPath.)
Public property PhysicalPath Gets the physical file-system path of the requested resource. (Overrides HttpRequestBase.PhysicalPath.)
Public property QueryString Gets the collection of HTTP query-string variables. (Overrides HttpRequestBase.QueryString.)
Public property RawUrl Gets the complete URL of the current request. (Overrides HttpRequestBase.RawUrl.)
Public property RequestContext Gets the RequestContext instance of the current request. (Overrides HttpRequestBase.RequestContext.)
Public property RequestType Gets or sets the HTTP data-transfer method (GET or POST) that was used by the client. (Overrides HttpRequestBase.RequestType.)
Public property ServerVariables Gets a collection of Web server variables. (Overrides HttpRequestBase.ServerVariables.)
Public property TotalBytes Gets the number of bytes in the current input stream. (Overrides HttpRequestBase.TotalBytes.)
Public property Url Gets information about the URL of the current request. (Overrides HttpRequestBase.Url.)
Public property UrlReferrer Gets information about the URL of the client request that linked to the current URL. (Overrides HttpRequestBase.UrlReferrer.)
Public property UserAgent Gets the complete user-agent string of the client. (Overrides HttpRequestBase.UserAgent.)
Public property UserHostAddress Gets the IP host address of the client. (Overrides HttpRequestBase.UserHostAddress.)
Public property UserHostName Gets the DNS name of the client. (Overrides HttpRequestBase.UserHostName.)
Public property UserLanguages Gets a sorted array of client language preferences. (Overrides HttpRequestBase.UserLanguages.)
Top
  Name Description
Public method BinaryRead Performs a binary read of a specified number of bytes from the current input stream. (Overrides HttpRequestBase.BinaryRead(Int32).)
Public method Equals(Object) Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public method GetHashCode Serves as a hash function for a particular type. (Inherited from Object.)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Public method MapImageCoordinates Maps an incoming image-field form parameter to appropriate x-coordinate and y-coordinate values. (Overrides HttpRequestBase.MapImageCoordinates(String).)
Public method MapPath(String) Maps the specified virtual path to a physical path on the server. (Overrides HttpRequestBase.MapPath(String).)
Public method MapPath(String, String, Boolean) Maps the specified virtual path to a physical path on the server. (Overrides HttpRequestBase.MapPath(String, String, Boolean).)
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public method SaveAs Saves an HTTP request to disk. (Overrides HttpRequestBase.SaveAs(String, Boolean).)
Public method ToString Returns a string that represents the current object. (Inherited from Object.)
Public method ValidateInput Causes validation to occur for the collections that are accessed through the Cookies, Form, and QueryString properties. (Overrides HttpRequestBase.ValidateInput().)
Top

The HttpRequestWrapper class derives from the HttpRequestBase class and serves as a wrapper for the HttpRequest class. This class exposes the functionality of the HttpRequest class and exposes the HttpRequestBase type. The HttpRequestBase class enables you to replace the original implementation of the HttpRequest class in your application with a custom implementation, such as when you perform unit testing outside the ASP.NET pipeline.

.NET Framework

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

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.
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ