websocket-sharp : WebSocketSharp.Net Namespace

# HttpListenerRequest Class

Provides access to a request to a WebSocketSharp.Net.HttpListener instance.

## Syntax

public sealed class HttpListenerRequest

## Remarks

The HttpListenerRequest class cannot be inherited.

## Requirements

Namespace: WebSocketSharp.Net
Assembly: websocket-sharp (in websocket-sharp.dll)

## Members

See Also: Inherited members from object.

## Public Properties

[read-only] | AcceptTypes | string[]. Gets the media types which are acceptable for the response.
[read-only] | ClientCertificateError | int . Gets an error code that identifies a problem with the client's certificate.
[read-only] | ContentEncoding | System.Text.Encoding . Gets the encoding that can be used with the entity body data included in the request.
[read-only] | ContentLength64 | long . Gets the size of the entity body data included in the request.
[read-only] | ContentType | string . Gets the media type of the entity body included in the request.
[read-only] | Cookies | CookieCollection . Gets the cookies included in the request.
[read-only] | HasEntityBody | bool . Gets a value indicating whether the request has the entity body.
[read-only] | Headers | System.Collections.Specialized.NameValueCollection . Gets the HTTP headers used in the request.
[read-only] | HttpMethod | string . Gets the HTTP method used in the request.
[read-only] | InputStream | System.IO.Stream . Gets a System.IO.Stream that contains the entity body data included in the request.
[read-only] | IsAuthenticated | bool . Gets a value indicating whether the client that sent the request is authenticated.
[read-only] | IsLocal | bool . Gets a value indicating whether the request is sent from the local computer.
[read-only] | IsSecureConnection | bool . Gets a value indicating whether the HTTP connection is secured using the SSL protocol.
[read-only] | IsWebSocketRequest | bool . Gets a value indicating whether the request is a WebSocket connection request.
[read-only] | KeepAlive | bool . Gets a value indicating whether the client requests a persistent connection.
[read-only] | LocalEndPoint | System.Net.IPEndPoint . Gets the server endpoint as an IP address and a port number.
[read-only] | ProtocolVersion | Version . Gets the HTTP version used in the request.
[read-only] | QueryString | System.Collections.Specialized.NameValueCollection . Gets the collection of query string variables used in the request.
[read-only] | RawUrl | string . Gets the raw URL (without the scheme, host and port) requested by the client.
[read-only] | RemoteEndPoint | System.Net.IPEndPoint . Gets the client endpoint as an IP address and a port number.
[read-only] | RequestTraceIdentifier | Guid . Gets the identifier of a request.
[read-only] | Url | Uri . Gets the URL requested by the client.
[read-only] | UrlReferrer | Uri . Gets the URL of the resource from which the requested URL was obtained.
[read-only] | UserAgent | string . Gets the information about the user agent originating the request.
[read-only] | UserHostAddress | string . Gets the server endpoint as an IP address and a port number.
[read-only] | UserHostName | string . Gets the internet host name and port number (if present) of the resource being requested.
[read-only] | UserLanguages | string[]. Gets the natural languages that are preferred as a response to the request.

## Public Methods

| BeginGetClientCertificate (AsyncCallback, object) : IAsyncResult Begins getting the client's X.509 v.3 certificate asynchronously.
| EndGetClientCertificate (IAsyncResult) : System.Security.Cryptography.X509Certificates.X509Certificate2 Ends an asynchronous operation to get the client's X.509 v.3 certificate.
| GetClientCertificate () : System.Security.Cryptography.X509Certificates.X509Certificate2 Gets the client's X.509 v.3 certificate.

## Extension Methods

static | IsNull<T> (this T) : bool Determines whether the specified object is `null`.
static | IsNullDo<T> (this T, Action) : bool Determines whether the specified object is `null`. And invokes the specified Action delegate if the specified object is `null`.
static | IsUpgradeTo (this HttpListenerRequest, string) : bool Determines whether the specified WebSocketSharp.Net.HttpListenerRequest is the HTTP Upgrade request to switch to the specified protocol.

## Member Details

### AcceptTypes Property

> Gets the media types which are acceptable for the response.

> ## Syntax

> public string[] AcceptTypes { get; }

> #### Value

> > An array of string that contains the media type names in the Accept request-header field or `null` if the request did not include an Accept header.

> ## Remarks

> Documentation for this section has not yet been entered.

> ## Requirements

> Namespace: WebSocketSharp.Net
> Assembly: websocket-sharp (in websocket-sharp.dll)

### BeginGetClientCertificate Method

> Begins getting the client's X.509 v.3 certificate asynchronously.

> ## Syntax

> public IAsyncResult BeginGetClientCertificate (AsyncCallback requestCallback, object state)

> #### Parameters

> > requestCallback
> >   An AsyncCallback delegate that references the method(s) called when the asynchronous operation completes.
> > state
> >   An object that contains a user defined object to pass to the requestCallback delegate.

> #### Returns

> > An IAsyncResult that contains the status of the asynchronous operation.

> #### Exceptions

> > Type | Reason
> > --- | ---
> > NotImplementedException | This method is not implemented.

> ## Remarks

> This asynchronous operation must be completed by calling the HttpListenerRequest.EndGetClientCertificate(IAsyncResult) method. Typically, the method is invoked by the requestCallback delegate.

> ## Requirements

> Namespace: WebSocketSharp.Net
> Assembly: websocket-sharp (in websocket-sharp.dll)

### ClientCertificateError Property

> Gets an error code that identifies a problem with the client's certificate.

> ## Syntax

> public int ClientCertificateError { get; }

> #### Value

> > Always returns `0`.

> ## Remarks

> Documentation for this section has not yet been entered.

> ## Requirements

> Namespace: WebSocketSharp.Net
> Assembly: websocket-sharp (in websocket-sharp.dll)

### ContentEncoding Property

> Gets the encoding that can be used with the entity body data included in the request.

> ## Syntax

> public System.Text.Encoding ContentEncoding { get; }

> #### Value

> > A System.Text.Encoding that contains the encoding that can be used with the entity body data.

> ## Remarks

> Documentation for this section has not yet been entered.

> ## Requirements

> Namespace: WebSocketSharp.Net
> Assembly: websocket-sharp (in websocket-sharp.dll)

### ContentLength64 Property

> Gets the size of the entity body data included in the request.

> ## Syntax

> public long ContentLength64 { get; }

> #### Value

> > A long that contains the value of the Content-Length entity-header field. The value is a number of bytes in the entity body data. `-1` if the size is not known.

> ## Remarks

> Documentation for this section has not yet been entered.

> ## Requirements

> Namespace: WebSocketSharp.Net
> Assembly: websocket-sharp (in websocket-sharp.dll)

### ContentType Property

> Gets the media type of the entity body included in the request.

> ## Syntax

> public string ContentType { get; }

> #### Value

> > A string that contains the value of the Content-Type entity-header field.

> ## Remarks

> Documentation for this section has not yet been entered.

> ## Requirements

> Namespace: WebSocketSharp.Net
> Assembly: websocket-sharp (in websocket-sharp.dll)

### Cookies Property

> Gets the cookies included in the request.

> ## Syntax

> public CookieCollection Cookies { get; }

> #### Value

> > A WebSocketSharp.Net.CookieCollection that contains the cookies included in the request.

> ## Remarks

> Documentation for this section has not yet been entered.

> ## Requirements

> Namespace: WebSocketSharp.Net
> Assembly: websocket-sharp (in websocket-sharp.dll)

### EndGetClientCertificate Method

> Ends an asynchronous operation to get the client's X.509 v.3 certificate.

> ## Syntax

> public System.Security.Cryptography.X509Certificates.X509Certificate2 EndGetClientCertificate (IAsyncResult asyncResult)

> #### Parameters

> > asyncResult
> >   An IAsyncResult obtained by calling the HttpListenerRequest.BeginGetClientCertificate(AsyncCallback, object) method.

> #### Returns

> > A System.Security.Cryptography.X509Certificates.X509Certificate2 that contains the client's X.509 v.3 certificate.

> #### Exceptions

> > Type | Reason
> > --- | ---
> > NotImplementedException | This method is not implemented.

> ## Remarks

> This method completes an asynchronous operation started by calling the HttpListenerRequest.BeginGetClientCertificate(AsyncCallback, object) method.

> ## Requirements

> Namespace: WebSocketSharp.Net
> Assembly: websocket-sharp (in websocket-sharp.dll)

### GetClientCertificate Method

> Gets the client's X.509 v.3 certificate.

> ## Syntax

> public System.Security.Cryptography.X509Certificates.X509Certificate2 GetClientCertificate ()

> #### Returns

> > A System.Security.Cryptography.X509Certificates.X509Certificate2 that contains the client's X.509 v.3 certificate.

> #### Exceptions

> > Type | Reason
> > --- | ---
> > NotImplementedException | This method is not implemented.

> ## Remarks

> Documentation for this section has not yet been entered.

> ## Requirements

> Namespace: WebSocketSharp.Net
> Assembly: websocket-sharp (in websocket-sharp.dll)

### HasEntityBody Property

> Gets a value indicating whether the request has the entity body.

> ## Syntax

> public bool HasEntityBody { get; }

> #### Value

> > `true` if the request has the entity body; otherwise, `false`.

> ## Remarks

> Documentation for this section has not yet been entered.

> ## Requirements

> Namespace: WebSocketSharp.Net
> Assembly: websocket-sharp (in websocket-sharp.dll)

### Headers Property

> Gets the HTTP headers used in the request.

> ## Syntax

> public System.Collections.Specialized.NameValueCollection Headers { get; }

> #### Value

> > A System.Collections.Specialized.NameValueCollection that contains the HTTP headers used in the request.

> ## Remarks

> Documentation for this section has not yet been entered.

> ## Requirements

> Namespace: WebSocketSharp.Net
> Assembly: websocket-sharp (in websocket-sharp.dll)

### HttpMethod Property

> Gets the HTTP method used in the request.

> ## Syntax

> public string HttpMethod { get; }

> #### Value

> > A string that contains the HTTP method used in the request.

> ## Remarks

> Documentation for this section has not yet been entered.

> ## Requirements

> Namespace: WebSocketSharp.Net
> Assembly: websocket-sharp (in websocket-sharp.dll)

### InputStream Property

> Gets a System.IO.Stream that contains the entity body data included in the request.

> ## Syntax

> public System.IO.Stream InputStream { get; }

> #### Value

> > A System.IO.Stream that contains the entity body data included in the request.

> ## Remarks

> Documentation for this section has not yet been entered.

> ## Requirements

> Namespace: WebSocketSharp.Net
> Assembly: websocket-sharp (in websocket-sharp.dll)

### IsAuthenticated Property

> Gets a value indicating whether the client that sent the request is authenticated.

> ## Syntax

> public bool IsAuthenticated { get; }

> #### Value

> > Always returns `false`.

> ## Remarks

> Documentation for this section has not yet been entered.

> ## Requirements

> Namespace: WebSocketSharp.Net
> Assembly: websocket-sharp (in websocket-sharp.dll)

### IsLocal Property

> Gets a value indicating whether the request is sent from the local computer.

> ## Syntax

> public bool IsLocal { get; }

> #### Value

> > `true` if the request is sent from the local computer; otherwise, `false`.

> ## Remarks

> Documentation for this section has not yet been entered.

> ## Requirements

> Namespace: WebSocketSharp.Net
> Assembly: websocket-sharp (in websocket-sharp.dll)

### IsSecureConnection Property

> Gets a value indicating whether the HTTP connection is secured using the SSL protocol.

> ## Syntax

> public bool IsSecureConnection { get; }

> #### Value

> > `true` if the HTTP connection is secured; otherwise, `false`.

> ## Remarks

> Documentation for this section has not yet been entered.

> ## Requirements

> Namespace: WebSocketSharp.Net
> Assembly: websocket-sharp (in websocket-sharp.dll)

### IsWebSocketRequest Property

> Gets a value indicating whether the request is a WebSocket connection request.

> ## Syntax

> public bool IsWebSocketRequest { get; }

> #### Value

> > `true` if the request is a WebSocket connection request; otherwise, `false`.

> ## Remarks

> Documentation for this section has not yet been entered.

> ## Requirements

> Namespace: WebSocketSharp.Net
> Assembly: websocket-sharp (in websocket-sharp.dll)

### KeepAlive Property

> Gets a value indicating whether the client requests a persistent connection.

> ## Syntax

> public bool KeepAlive { get; }

> #### Value

> > `true` if the client requests a persistent connection; otherwise, `false`.

> ## Remarks

> Documentation for this section has not yet been entered.

> ## Requirements

> Namespace: WebSocketSharp.Net
> Assembly: websocket-sharp (in websocket-sharp.dll)

### LocalEndPoint Property

> Gets the server endpoint as an IP address and a port number.

> ## Syntax

> public System.Net.IPEndPoint LocalEndPoint { get; }

> #### Value

> > A System.Net.IPEndPoint that contains the server endpoint.

> ## Remarks

> Documentation for this section has not yet been entered.

> ## Requirements

> Namespace: WebSocketSharp.Net
> Assembly: websocket-sharp (in websocket-sharp.dll)

### ProtocolVersion Property

> Gets the HTTP version used in the request.

> ## Syntax

> public Version ProtocolVersion { get; }

> #### Value

> > A Version that contains the HTTP version used in the request.

> ## Remarks

> Documentation for this section has not yet been entered.

> ## Requirements

> Namespace: WebSocketSharp.Net
> Assembly: websocket-sharp (in websocket-sharp.dll)

### QueryString Property

> Gets the collection of query string variables used in the request.

> ## Syntax

> public System.Collections.Specialized.NameValueCollection QueryString { get; }

> #### Value

> > A System.Collections.Specialized.NameValueCollection that contains the collection of query string variables used in the request.

> ## Remarks

> Documentation for this section has not yet been entered.

> ## Requirements

> Namespace: WebSocketSharp.Net
> Assembly: websocket-sharp (in websocket-sharp.dll)

### RawUrl Property

> Gets the raw URL (without the scheme, host and port) requested by the client.

> ## Syntax

> public string RawUrl { get; }

> #### Value

> > A string that contains the raw URL requested by the client.

> ## Remarks

> Documentation for this section has not yet been entered.

> ## Requirements

> Namespace: WebSocketSharp.Net
> Assembly: websocket-sharp (in websocket-sharp.dll)

### RemoteEndPoint Property

> Gets the client endpoint as an IP address and a port number.

> ## Syntax

> public System.Net.IPEndPoint RemoteEndPoint { get; }

> #### Value

> > A System.Net.IPEndPoint that contains the client endpoint.

> ## Remarks

> Documentation for this section has not yet been entered.

> ## Requirements

> Namespace: WebSocketSharp.Net
> Assembly: websocket-sharp (in websocket-sharp.dll)

### RequestTraceIdentifier Property

> Gets the identifier of a request.

> ## Syntax

> public Guid RequestTraceIdentifier { get; }

> #### Value

> > A Guid that contains the identifier of a request.

> ## Remarks

> Documentation for this section has not yet been entered.

> ## Requirements

> Namespace: WebSocketSharp.Net
> Assembly: websocket-sharp (in websocket-sharp.dll)

### Url Property

> Gets the URL requested by the client.

> ## Syntax

> public Uri Url { get; }

> #### Value

> > A Uri that contains the URL requested by the client.

> ## Remarks

> Documentation for this section has not yet been entered.

> ## Requirements

> Namespace: WebSocketSharp.Net
> Assembly: websocket-sharp (in websocket-sharp.dll)

### UrlReferrer Property

> Gets the URL of the resource from which the requested URL was obtained.

> ## Syntax

> public Uri UrlReferrer { get; }

> #### Value

> > A Uri that contains the value of the Referer request-header field.

> ## Remarks

> Documentation for this section has not yet been entered.

> ## Requirements

> Namespace: WebSocketSharp.Net
> Assembly: websocket-sharp (in websocket-sharp.dll)

### UserAgent Property

> Gets the information about the user agent originating the request.

> ## Syntax

> public string UserAgent { get; }

> #### Value

> > A string that contains the value of the User-Agent request-header field.

> ## Remarks

> Documentation for this section has not yet been entered.

> ## Requirements

> Namespace: WebSocketSharp.Net
> Assembly: websocket-sharp (in websocket-sharp.dll)

### UserHostAddress Property

> Gets the server endpoint as an IP address and a port number.

> ## Syntax

> public string UserHostAddress { get; }

> #### Value

> > A string that contains the server endpoint.

> ## Remarks

> Documentation for this section has not yet been entered.

> ## Requirements

> Namespace: WebSocketSharp.Net
> Assembly: websocket-sharp (in websocket-sharp.dll)

### UserHostName Property

> Gets the internet host name and port number (if present) of the resource being requested.

> ## Syntax

> public string UserHostName { get; }

> #### Value

> > A string that contains the value of the Host request-header field.

> ## Remarks

> Documentation for this section has not yet been entered.

> ## Requirements

> Namespace: WebSocketSharp.Net
> Assembly: websocket-sharp (in websocket-sharp.dll)

### UserLanguages Property

> Gets the natural languages that are preferred as a response to the request.

> ## Syntax

> public string[] UserLanguages { get; }

> #### Value

> > An array of string that contains the natural language names in the Accept-Language request-header field.

> ## Remarks

> Documentation for this section has not yet been entered.

> ## Requirements

> Namespace: WebSocketSharp.Net
> Assembly: websocket-sharp (in websocket-sharp.dll)