SimpleWorkerRequest Class

Definition

Provides a simple implementation of the HttpWorkerRequest abstract class that can be used to host ASP.NET applications outside an Internet Information Services (IIS) application. You can employ SimpleWorkerRequest directly or extend it.

public ref class SimpleWorkerRequest : System::Web::HttpWorkerRequest
[System.Runtime.InteropServices.ComVisible(false)]
public class SimpleWorkerRequest : System.Web.HttpWorkerRequest
[<System.Runtime.InteropServices.ComVisible(false)>]
type SimpleWorkerRequest = class
    inherit HttpWorkerRequest
Public Class SimpleWorkerRequest
Inherits HttpWorkerRequest
Inheritance
SimpleWorkerRequest
Attributes

Remarks

This simple implementation of HttpWorkerRequest provides the request URL and the query string and captures the body of the output into a TextWriter. To achieve richer functionality, such as providing posted content and headers and capturing the response headers or response body as binary data, you should extend SimpleWorkerRequest and override the appropriate HttpWorkerRequest methods.

Constructors

SimpleWorkerRequest(String, String, String, String, TextWriter)

Initializes a new instance of the SimpleWorkerRequest class for use in an arbitrary application domain, when the user code creates an HttpContext (passing the SimpleWorkerRequest as an argument to the HttpContext constructor).

SimpleWorkerRequest(String, String, TextWriter)

Initializes a new instance of the SimpleWorkerRequest class when the target application domain has been created using the CreateApplicationHost(Type, String, String) method.

Fields

HeaderAccept

Specifies the index number for the Accept HTTP header.

(Inherited from HttpWorkerRequest)
HeaderAcceptCharset

Specifies the index number for the Accept-Charset HTTP header.

(Inherited from HttpWorkerRequest)
HeaderAcceptEncoding

Specifies the index number for the Accept-Encoding HTTP header.

(Inherited from HttpWorkerRequest)
HeaderAcceptLanguage

Specifies the index number for the Accept-Language HTTP header.

(Inherited from HttpWorkerRequest)
HeaderAcceptRanges

Specifies the index number for the Accept-Ranges HTTP header.

(Inherited from HttpWorkerRequest)
HeaderAge

Specifies the index number for the Age HTTP header.

(Inherited from HttpWorkerRequest)
HeaderAllow

Specifies the index number for the Allow HTTP header.

(Inherited from HttpWorkerRequest)
HeaderAuthorization

Specifies the index number for the Authorization HTTP header.

(Inherited from HttpWorkerRequest)
HeaderCacheControl

The index that represents the HTTP Cache-Control HTTP header.

(Inherited from HttpWorkerRequest)
HeaderConnection

Specifies the index number for the Connection HTTP header.

(Inherited from HttpWorkerRequest)
HeaderContentEncoding

Specifies the index number for the Content-Encoding HTTP header.

(Inherited from HttpWorkerRequest)
HeaderContentLanguage

Specifies the index number for the Content-Language HTTP header.

(Inherited from HttpWorkerRequest)
HeaderContentLength

Specifies the index number for the Content-Length HTTP header.

(Inherited from HttpWorkerRequest)
HeaderContentLocation

Specifies the index number for the Content-Location HTTP header.

(Inherited from HttpWorkerRequest)
HeaderContentMd5

Specifies the index number for the Content-MD5 HTTP header.

(Inherited from HttpWorkerRequest)
HeaderContentRange

Specifies the index number for the Content-Range HTTP header.

(Inherited from HttpWorkerRequest)
HeaderContentType

Specifies the index number for the Content-Type HTTP header.

(Inherited from HttpWorkerRequest)
HeaderCookie

Specifies the index number for the Cookie HTTP header.

(Inherited from HttpWorkerRequest)
HeaderDate

Specifies the index number for the Date HTTP header.

(Inherited from HttpWorkerRequest)
HeaderEtag

Specifies the index number for the ETag HTTP header.

(Inherited from HttpWorkerRequest)
HeaderExpect

Specifies the index number for the Except HTTP header.

(Inherited from HttpWorkerRequest)
HeaderExpires

Specifies the index number for the Expires HTTP header.

(Inherited from HttpWorkerRequest)
HeaderFrom

Specifies the index number for the From HTTP header.

(Inherited from HttpWorkerRequest)
HeaderHost

Specifies the index number for the Host HTTP header.

(Inherited from HttpWorkerRequest)
HeaderIfMatch

Specifies the index number for the If-Match HTTP header.

(Inherited from HttpWorkerRequest)
HeaderIfModifiedSince

Specifies the index number for the If-Modified-Since HTTP header.

(Inherited from HttpWorkerRequest)
HeaderIfNoneMatch

Specifies the index number for the If-None-Match HTTP header.

(Inherited from HttpWorkerRequest)
HeaderIfRange

Specifies the index number for the If-Range HTTP header.

(Inherited from HttpWorkerRequest)
HeaderIfUnmodifiedSince

Specifies the index number for the If-Unmodified-Since HTTP header.

(Inherited from HttpWorkerRequest)
HeaderKeepAlive

Specifies the index number for the Keep-Alive HTTP header.

(Inherited from HttpWorkerRequest)
HeaderLastModified

Specifies the index number for the Last-Modified HTTP header.

(Inherited from HttpWorkerRequest)
HeaderLocation

Specifies the index number for the Location HTTP header.

(Inherited from HttpWorkerRequest)
HeaderMaxForwards

Specifies the index number for the Max-Forwards HTTP header.

(Inherited from HttpWorkerRequest)
HeaderPragma

Specifies the index number for the Pragma HTTP header.

(Inherited from HttpWorkerRequest)
HeaderProxyAuthenticate

Specifies the index number for the Proxy-Authenticate HTTP header.

(Inherited from HttpWorkerRequest)
HeaderProxyAuthorization

Specifies the index number for the Proxy-Authorization HTTP header.

(Inherited from HttpWorkerRequest)
HeaderRange

Specifies the index number for the Range HTTP header.

(Inherited from HttpWorkerRequest)
HeaderReferer

Specifies the index number for the Referer HTTP header.

(Inherited from HttpWorkerRequest)
HeaderRetryAfter

Specifies the index number for the Retry-After HTTP header.

(Inherited from HttpWorkerRequest)
HeaderServer

Specifies the index number for the Server HTTP header.

(Inherited from HttpWorkerRequest)
HeaderSetCookie

Specifies the index number for the Set-Cookie HTTP header.

(Inherited from HttpWorkerRequest)
HeaderTe

Specifies the index number for the TE HTTP header.

(Inherited from HttpWorkerRequest)
HeaderTrailer

Specifies the index number for the Trailer HTTP header.

(Inherited from HttpWorkerRequest)
HeaderTransferEncoding

Specifies the index number for the Transfer-Encoding HTTP header.

(Inherited from HttpWorkerRequest)
HeaderUpgrade

Specifies the index number for the Upgrade HTTP header.

(Inherited from HttpWorkerRequest)
HeaderUserAgent

Specifies the index number for the User-Agent HTTP header.

(Inherited from HttpWorkerRequest)
HeaderVary

Specifies the index number for the Vary HTTP header.

(Inherited from HttpWorkerRequest)
HeaderVia

Specifies the index number for the Via HTTP header.

(Inherited from HttpWorkerRequest)
HeaderWarning

Specifies the index number for the Warning HTTP header.

(Inherited from HttpWorkerRequest)
HeaderWwwAuthenticate

Specifies the index number for the WWW-Authenticate HTTP header.

(Inherited from HttpWorkerRequest)
ReasonCachePolicy

Specifies a reason for the request.

(Inherited from HttpWorkerRequest)
ReasonCacheSecurity

Specifies a reason for the request.

(Inherited from HttpWorkerRequest)
ReasonClientDisconnect

Specifies a reason for the request.

(Inherited from HttpWorkerRequest)
ReasonDefault

Specifies a reason for the request. The default value is ReasonResponseCacheMiss.

(Inherited from HttpWorkerRequest)
ReasonFileHandleCacheMiss

Specifies a reason for the request.

(Inherited from HttpWorkerRequest)
ReasonResponseCacheMiss

Specifies a reason for the request.

(Inherited from HttpWorkerRequest)
RequestHeaderMaximum

Specifies the index number for the Maximum HTTP request header.

(Inherited from HttpWorkerRequest)
ResponseHeaderMaximum

Specifies the index number for the Maximum HTTP response header.

(Inherited from HttpWorkerRequest)

Properties

MachineConfigPath

Gets the full physical path to the Machine.config file.

MachineInstallDirectory

Gets the physical path to the directory where the ASP.NET binaries are installed.

RequestTraceIdentifier

Gets the corresponding Event Tracking for Windows trace ID for the current request.

(Inherited from HttpWorkerRequest)
RootWebConfigPath

Gets the full physical path to the root Web.config file.

RootWebConfigPath

Gets the full physical path to the root Web.config file.

(Inherited from HttpWorkerRequest)
SupportsAsyncFlush

Gets a value that indicates whether asynchronous flush operations are supported.

(Inherited from HttpWorkerRequest)
SupportsAsyncRead

Gets a value that indicates whether asynchronous read operations are supported.

(Inherited from HttpWorkerRequest)

Methods

BeginFlush(AsyncCallback, Object)

Sends the currently buffered response to the client.

(Inherited from HttpWorkerRequest)
BeginRead(Byte[], Int32, Int32, AsyncCallback, Object)

Begins an asynchronous read operation of the request entity body.

(Inherited from HttpWorkerRequest)
CloseConnection()

Terminates the connection with the client.

(Inherited from HttpWorkerRequest)
EndFlush(IAsyncResult)

Waits for the pending asynchronous flush operation to complete.

(Inherited from HttpWorkerRequest)
EndOfRequest()

Notifies the HttpWorkerRequest that request processing for the current request is complete.

EndRead(IAsyncResult)

Waits for the pending asynchronous read operation to complete.

(Inherited from HttpWorkerRequest)
Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
FlushResponse(Boolean)

Sends all pending response data to the client.

GetAppPath()

Returns the virtual path to the currently executing server application.

GetAppPathTranslated()

Returns the UNC-translated path to the currently executing server application.

GetAppPoolID()

When overridden in a derived class, returns the application pool ID for the current URL.

(Inherited from HttpWorkerRequest)
GetBytesRead()

Gets the number of bytes read in from the client.

(Inherited from HttpWorkerRequest)
GetClientCertificate()

When overridden in a derived class, gets the certification fields (specified in the X.509 standard) from a request issued by the client.

(Inherited from HttpWorkerRequest)
GetClientCertificateBinaryIssuer()

Gets the certificate issuer, in binary format.

(Inherited from HttpWorkerRequest)
GetClientCertificateEncoding()

When overridden in a derived class, returns the Encoding object in which the client certificate was encoded.

(Inherited from HttpWorkerRequest)
GetClientCertificatePublicKey()

When overridden in a derived class, gets a PublicKey object associated with the client certificate.

(Inherited from HttpWorkerRequest)
GetClientCertificateValidFrom()

When overridden in a derived class, gets the date when the certificate becomes valid. The date varies with international settings.

(Inherited from HttpWorkerRequest)
GetClientCertificateValidUntil()

Gets the certificate expiration date.

(Inherited from HttpWorkerRequest)
GetConnectionID()

When overridden in a derived class, returns the ID of the current connection.

(Inherited from HttpWorkerRequest)
GetFilePath()

Returns the physical path to the requested URI.

GetFilePathTranslated()

Returns 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")

GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetHttpVerbName()

Returns the HTTP request verb.

GetHttpVersion()

Returns the HTTP version string of the request (for example, "HTTP/1.1").

GetKnownRequestHeader(Int32)

Returns the standard HTTP request header that corresponds to the specified index.

(Inherited from HttpWorkerRequest)
GetLocalAddress()

Returns the server IP address of the interface on which the request was received.

GetLocalPort()

Returns the port number on which the request was received.

GetPathInfo()

Returns additional path information for a resource with a URL extension. That is, for the path /virdir/page.html/tail, the return value is /tail.

GetPreloadedEntityBody()

Returns the portion of the HTTP request body that has already been read.

(Inherited from HttpWorkerRequest)
GetPreloadedEntityBody(Byte[], Int32)

Gets the portion of the HTTP request body that has currently been read by using the specified buffer data and byte offset.

(Inherited from HttpWorkerRequest)
GetPreloadedEntityBodyLength()

Gets the length of the portion of the HTTP request body that has currently been read.

(Inherited from HttpWorkerRequest)
GetProtocol()

When overridden in a derived class, returns the HTTP protocol (HTTP or HTTPS).

(Inherited from HttpWorkerRequest)
GetQueryString()

Returns the query string specified in the request URL.

GetQueryStringRawBytes()

When overridden in a derived class, returns the response query string as an array of bytes.

(Inherited from HttpWorkerRequest)
GetRawUrl()

Returns the URL path contained in the header with the query string appended.

GetRemoteAddress()

Returns the IP address of the client.

GetRemoteName()

When overridden in a derived class, returns the name of the client computer.

(Inherited from HttpWorkerRequest)
GetRemotePort()

Returns the client's port number.

GetRequestReason()

When overridden in a derived class, returns the reason for the request.

(Inherited from HttpWorkerRequest)
GetServerName()

When overridden in a derived class, returns the name of the local server.

(Inherited from HttpWorkerRequest)
GetServerVariable(String)

Returns a single server variable from a dictionary of server variables associated with the request.

GetTotalEntityBodyLength()

Gets the length of the entire HTTP request body.

(Inherited from HttpWorkerRequest)
GetType()

Gets the Type of the current instance.

(Inherited from Object)
GetUnknownRequestHeader(String)

Returns a nonstandard HTTP request header value.

(Inherited from HttpWorkerRequest)
GetUnknownRequestHeaders()

Get all nonstandard HTTP header name-value pairs.

(Inherited from HttpWorkerRequest)
GetUriPath()

Returns the virtual path to the requested URI.

GetUrlContextID()

When overridden in a derived class, returns the context ID of the current connection.

(Inherited from HttpWorkerRequest)
GetUserToken()

Returns the client's impersonation token.

GetVirtualPathToken()

Gets the impersonation token for the request virtual path.

(Inherited from HttpWorkerRequest)
HasEntityBody()

Returns a value indicating whether the request contains body data.

(Inherited from HttpWorkerRequest)
HeadersSent()

Returns a value indicating whether HTTP response headers have been sent to the client for the current request.

(Inherited from HttpWorkerRequest)
IsClientConnected()

Returns a value indicating whether the client connection is still active.

(Inherited from HttpWorkerRequest)
IsEntireEntityBodyIsPreloaded()

Returns a value indicating whether all request data is available and no further reads from the client are required.

(Inherited from HttpWorkerRequest)
IsSecure()

Returns a value indicating whether the connection uses SSL.

(Inherited from HttpWorkerRequest)
MapPath(String)

Returns the physical path corresponding to the specified virtual path.

MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ReadEntityBody(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.

(Inherited from HttpWorkerRequest)
ReadEntityBody(Byte[], Int32)

Reads request data from the client (when not preloaded).

(Inherited from HttpWorkerRequest)
SendCalculatedContentLength(Int32)

Adds a Content-Length HTTP header to the response for message bodies that are less than or equal to 2 GB.

(Inherited from HttpWorkerRequest)
SendCalculatedContentLength(Int64)

Adds a Content-Length HTTP header to the response for message bodies that are greater than 2 GB.

(Inherited from HttpWorkerRequest)
SendKnownResponseHeader(Int32, String)

Adds a standard HTTP header to the response.

SendResponseFromFile(IntPtr, Int64, Int64)

Adds the contents of the file with the specified handle to the response and specifies the starting position in the file and the number of bytes to send.

SendResponseFromFile(String, Int64, Int64)

Adds the contents of the file with the specified name to the response and specifies the starting position in the file and the number of bytes to send.

SendResponseFromMemory(Byte[], Int32)

Adds the contents of a byte array to the response and specifies the number of bytes to send.

SendResponseFromMemory(IntPtr, Int32)

Adds the specified number of bytes from a block of memory to the response.

(Inherited from HttpWorkerRequest)
SendStatus(Int32, String)

Specifies the HTTP status code and status description of the response; for example, SendStatus(200, "Ok").

SendUnknownResponseHeader(String, String)

Adds a nonstandard HTTP header to the response.

SetEndOfSendNotification(HttpWorkerRequest+EndOfSendNotification, Object)

Registers for an optional notification when all the response data is sent.

(Inherited from HttpWorkerRequest)
ToString()

Returns a string that represents the current object.

(Inherited from Object)

Applies to