Export (0) Print
Expand All

HttpWorkerRequest Class

This abstract class defines the base worker methods and enumerations used by ASP.NET managed code to process requests.

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

[ComVisibleAttribute(false)]
public abstract class HttpWorkerRequest

The HttpWorkerRequest type exposes the following members.

  NameDescription
Protected methodHttpWorkerRequestInitializes a new instance of the HttpWorkerRequest class.
Top

  NameDescription
Public propertyMachineConfigPathGets the full physical path to the Machine.config file.
Public propertyMachineInstallDirectoryGets the physical path to the directory where the ASP.NET binaries are installed.
Public propertyRequestTraceIdentifierGets the corresponding Event Tracking for Windows trace ID for the current request.
Public propertyRootWebConfigPathGets the full physical path to the root Web.config file.
Public propertySupportsAsyncFlushGets a value that indicates whether asynchronous flush operations are supported.
Public propertySupportsAsyncReadGets a value that indicates whether asynchronous read operations are supported.
Top

  NameDescription
Public methodBeginFlushSends the currently buffered response to the client.
Public methodBeginReadBegins an asynchronous read operation of the request entity body.
Public methodCloseConnectionTerminates the connection with the client.
Public methodEndFlushWaits for the pending asynchronous flush operation to complete.
Public methodEndOfRequestUsed by the runtime to notify the HttpWorkerRequest that request processing for the current request is complete.
Public methodEndReadWaits for the pending asynchronous read operation to complete.
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 methodFlushResponseSends all pending response data to the client.
Public methodGetAppPathReturns the virtual path to the currently executing server application.
Public methodGetAppPathTranslatedReturns the physical path to the currently executing server application.
Public methodGetAppPoolIDInfrastructure. When overridden in a derived class, returns the application pool ID for the current URL.
Public methodGetBytesReadInfrastructure. Gets the number of bytes read in from the client.
Public methodGetClientCertificateInfrastructure. When overridden in a derived class, gets the certification fields (specified in the X.509 standard) from a request issued by the client.
Public methodGetClientCertificateBinaryIssuerInfrastructure. Gets the certificate issuer, in binary format.
Public methodGetClientCertificateEncodingInfrastructure. When overridden in a derived class, returns the Encoding object in which the client certificate was encoded.
Public methodGetClientCertificatePublicKeyInfrastructure. When overridden in a derived class, gets a PublicKey object associated with the client certificate.
Public methodGetClientCertificateValidFromInfrastructure. When overridden in a derived class, gets the date when the certificate becomes valid. The date varies with international settings.
Public methodGetClientCertificateValidUntilInfrastructure. Gets the certificate expiration date.
Public methodGetConnectionIDInfrastructure. When overridden in a derived class, returns the ID of the current connection.
Public methodGetFilePathWhen overridden in a derived class, returns the virtual path to the requested URI.
Public methodGetFilePathTranslatedReturns the physical file path to the requested URI (and translates it from virtual path to physical path: for example, "/proj1/page.aspx" to "c:\dir\page.aspx")
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetHttpVerbNameReturns the specified member of the request header.
Public methodGetHttpVersionProvides access to the HTTP version of the request (for example, "HTTP/1.1").
Public methodGetKnownRequestHeaderReturns the standard HTTP request header that corresponds to the specified index.
Public methodStatic memberGetKnownRequestHeaderIndexReturns the index number of the specified HTTP request header.
Public methodStatic memberGetKnownRequestHeaderNameReturns the name of the specified HTTP request header.
Public methodStatic memberGetKnownResponseHeaderIndexReturns the index number of the specified HTTP response header.
Public methodStatic memberGetKnownResponseHeaderNameReturns the name of the specified HTTP response header.
Public methodGetLocalAddressProvides access to the specified member of the request header.
Public methodGetLocalPortProvides access to the specified member of the request header.
Public methodGetPathInfoReturns additional path information for a resource with a URL extension. That is, for the path /virdir/page.html/tail, the GetPathInfo value is /tail.
Public methodGetPreloadedEntityBody()Returns the portion of the HTTP request body that has already been read.
Public methodGetPreloadedEntityBody(Byte[], Int32)Gets the portion of the HTTP request body that has currently been read by using the specified buffer data and byte offset.
Public methodGetPreloadedEntityBodyLengthGets the length of the portion of the HTTP request body that has currently been read.
Public methodGetProtocolWhen overridden in a derived class, returns the HTTP protocol (HTTP or HTTPS).
Public methodGetQueryStringReturns the query string specified in the request URL.
Public methodGetQueryStringRawBytesWhen overridden in a derived class, returns the response query string as an array of bytes.
Public methodGetRawUrlReturns the URL path contained in the request header with the query string appended.
Public methodGetRemoteAddressProvides access to the specified member of the request header.
Public methodGetRemoteNameWhen overridden in a derived class, returns the name of the client computer.
Public methodGetRemotePortProvides access to the specified member of the request header.
Public methodGetRequestReasonInfrastructure. When overridden in a derived class, returns the reason for the request.
Public methodGetServerNameWhen overridden in a derived class, returns the name of the local server.
Public methodGetServerVariableReturns a single server variable from a dictionary of server variables associated with the request.
Public methodStatic memberGetStatusDescriptionReturns a string that describes the name of the specified HTTP status code.
Public methodGetTotalEntityBodyLengthGets the length of the entire HTTP request body.
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodGetUnknownRequestHeaderReturns a nonstandard HTTP request header value.
Public methodGetUnknownRequestHeadersGet all nonstandard HTTP header name-value pairs.
Public methodGetUriPathReturns the virtual path to the requested URI.
Public methodGetUrlContextIDInfrastructure. When overridden in a derived class, returns the context ID of the current connection.
Public methodGetUserTokenWhen overridden in a derived class, returns the client's impersonation token.
Public methodGetVirtualPathTokenInfrastructure. Gets the impersonation token for the request virtual path.
Public methodHasEntityBodyReturns a value indicating whether the request contains body data.
Public methodHeadersSentReturns a value indicating whether HTTP response headers have been sent to the client for the current request.
Public methodIsClientConnectedReturns a value indicating whether the client connection is still active.
Public methodIsEntireEntityBodyIsPreloadedReturns a value indicating whether all request data is available and no further reads from the client are required.
Public methodIsSecureReturns a value indicating whether the connection uses SSL.
Public methodMapPathReturns the physical path corresponding to the specified virtual path.
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodReadEntityBody(Byte[], Int32)Reads request data from the client (when not preloaded).
Public methodReadEntityBody(Byte[], Int32, Int32)Reads request data from the client (when not preloaded) by using the specified buffer to read from, byte offset, and maximum bytes.
Public methodSendCalculatedContentLength(Int32)Adds a Content-Length HTTP header to the response for message bodies that are less than or equal to 2 GB.
Public methodSendCalculatedContentLength(Int64)Adds a Content-Length HTTP header to the response for message bodies that are greater than 2 GB.
Public methodSendKnownResponseHeaderAdds a standard HTTP header to the response.
Public methodSendResponseFromFile(IntPtr, Int64, Int64)Adds the contents of the specified file to the response and specifies the starting position in the file and the number of bytes to send.
Public methodSendResponseFromFile(String, Int64, Int64)Adds the contents of the specified file to the response and specifies the starting position in the file and the number of bytes to send.
Public methodSendResponseFromMemory(Byte[], Int32)Adds the specified number of bytes from a byte array to the response.
Public methodSendResponseFromMemory(IntPtr, Int32)Adds the specified number of bytes from a block of memory to the response.
Public methodSendStatusSpecifies the HTTP status code and status description of the response, such as SendStatus(200, "Ok").
Public methodSendUnknownResponseHeaderAdds a nonstandard HTTP header to the response.
Public methodSetEndOfSendNotificationRegisters for an optional notification when all the response data is sent.
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top

  NameDescription
Public fieldStatic memberHeaderAcceptSpecifies the index number for the Accept HTTP header.
Public fieldStatic memberHeaderAcceptCharsetSpecifies the index number for the Accept-Charset HTTP header.
Public fieldStatic memberHeaderAcceptEncodingSpecifies the index number for the Accept-Encoding HTTP header.
Public fieldStatic memberHeaderAcceptLanguageSpecifies the index number for the Accept-Language HTTP header.
Public fieldStatic memberHeaderAcceptRangesSpecifies the index number for the Accept-Ranges HTTP header.
Public fieldStatic memberHeaderAgeSpecifies the index number for the Age HTTP header.
Public fieldStatic memberHeaderAllowSpecifies the index number for the Allow HTTP header.
Public fieldStatic memberHeaderAuthorizationSpecifies the index number for the Authorization HTTP header.
Public fieldStatic memberHeaderCacheControlThe index that represents the HTTP Cache-Control HTTP header.
Public fieldStatic memberHeaderConnectionSpecifies the index number for the Connection HTTP header.
Public fieldStatic memberHeaderContentEncodingSpecifies the index number for the Content-Encoding HTTP header.
Public fieldStatic memberHeaderContentLanguageSpecifies the index number for the Content-Language HTTP header.
Public fieldStatic memberHeaderContentLengthSpecifies the index number for the Content-Length HTTP header.
Public fieldStatic memberHeaderContentLocationSpecifies the index number for the Content-Location HTTP header.
Public fieldStatic memberHeaderContentMd5Specifies the index number for the Content-MD5 HTTP header.
Public fieldStatic memberHeaderContentRangeSpecifies the index number for the Content-Range HTTP header.
Public fieldStatic memberHeaderContentTypeSpecifies the index number for the Content-Type HTTP header.
Public fieldStatic memberHeaderCookieSpecifies the index number for the Cookie HTTP header.
Public fieldStatic memberHeaderDateSpecifies the index number for the Date HTTP header.
Public fieldStatic memberHeaderEtagSpecifies the index number for the ETag HTTP header.
Public fieldStatic memberHeaderExpectSpecifies the index number for the Except HTTP header.
Public fieldStatic memberHeaderExpiresSpecifies the index number for the Expires HTTP header.
Public fieldStatic memberHeaderFromSpecifies the index number for the From HTTP header.
Public fieldStatic memberHeaderHostSpecifies the index number for the Host HTTP header.
Public fieldStatic memberHeaderIfMatchSpecifies the index number for the If-Match HTTP header.
Public fieldStatic memberHeaderIfModifiedSinceSpecifies the index number for the If-Modified-Since HTTP header.
Public fieldStatic memberHeaderIfNoneMatchSpecifies the index number for the If-None-Match HTTP header.
Public fieldStatic memberHeaderIfRangeSpecifies the index number for the If-Range HTTP header.
Public fieldStatic memberHeaderIfUnmodifiedSinceSpecifies the index number for the If-Unmodified-Since HTTP header.
Public fieldStatic memberHeaderKeepAliveSpecifies the index number for the Keep-Alive HTTP header.
Public fieldStatic memberHeaderLastModifiedSpecifies the index number for the Last-Modified HTTP header.
Public fieldStatic memberHeaderLocationSpecifies the index number for the Location HTTP header.
Public fieldStatic memberHeaderMaxForwardsSpecifies the index number for the Max-Forwards HTTP header.
Public fieldStatic memberHeaderPragmaSpecifies the index number for the Pragma HTTP header.
Public fieldStatic memberHeaderProxyAuthenticateSpecifies the index number for the Proxy-Authenticate HTTP header.
Public fieldStatic memberHeaderProxyAuthorizationSpecifies the index number for the Proxy-Authorization HTTP header.
Public fieldStatic memberHeaderRangeSpecifies the index number for the Range HTTP header.
Public fieldStatic memberHeaderRefererSpecifies the index number for the Referer HTTP header.
Public fieldStatic memberHeaderRetryAfterSpecifies the index number for the Retry-After HTTP header.
Public fieldStatic memberHeaderServerSpecifies the index number for the Server HTTP header.
Public fieldStatic memberHeaderSetCookieSpecifies the index number for the Set-Cookie HTTP header.
Public fieldStatic memberHeaderTeSpecifies the index number for the TE HTTP header.
Public fieldStatic memberHeaderTrailerSpecifies the index number for the Trailer HTTP header.
Public fieldStatic memberHeaderTransferEncodingSpecifies the index number for the Transfer-Encoding HTTP header.
Public fieldStatic memberHeaderUpgradeSpecifies the index number for the Upgrade HTTP header.
Public fieldStatic memberHeaderUserAgentSpecifies the index number for the User-Agent HTTP header.
Public fieldStatic memberHeaderVarySpecifies the index number for the Vary HTTP header.
Public fieldStatic memberHeaderViaSpecifies the index number for the Via HTTP header.
Public fieldStatic memberHeaderWarningSpecifies the index number for the Warning HTTP header.
Public fieldStatic memberHeaderWwwAuthenticateSpecifies the index number for the WWW-Authenticate HTTP header.
Public fieldStatic memberReasonCachePolicyInfrastructure. Specifies a reason for the request.
Public fieldStatic memberReasonCacheSecurityInfrastructure. Specifies a reason for the request.
Public fieldStatic memberReasonClientDisconnectInfrastructure. Specifies a reason for the request.
Public fieldStatic memberReasonDefaultInfrastructure. Specifies a reason for the request. The default value is ReasonResponseCacheMiss.
Public fieldStatic memberReasonFileHandleCacheMissInfrastructure. Specifies a reason for the request.
Public fieldStatic memberReasonResponseCacheMissInfrastructure. Specifies a reason for the request.
Public fieldStatic memberRequestHeaderMaximumSpecifies the index number for the Maximum HTTP request header.
Public fieldStatic memberResponseHeaderMaximumSpecifies the index number for the Maximum HTTP response header.
Top

In most cases, your code will not deal with HttpWorkerRequest directly because request and response data are exposed through the HttpRequest and HttpResponse classes. Some internal ASP.NET classes extend this class. If your code implements its own hosting environment, it will need to extend this class to call the ProcessRequest method. In addition, your code could create a derived class for the purpose of child-request execution within a given application in order to pass its instance to ProcessRequest. In this case, the derived class should keep a reference to the current HttpWorkerRequest and delegate most of the methods to it.

.NET Framework

Supported in: 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0

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