HttpListenerRequest.RawUrl Property

Note: This property is new in the .NET Framework version 2.0.

Gets the URL information (without the host and port) requested by the client.

Namespace: System.Net
Assembly: System (in system.dll)

public string RawUrl { get; }
/** @property */
public String get_RawUrl ()

public function get RawUrl () : String

Property Value

A String that contains the raw URL for this request.

The raw URL is defined as the part of the URL following the domain information. In the URL string, the raw URL is /articles/recent.aspx. The raw URL includes the query string, if present.

To obtain the host and port information, use the RemoteEndPoint property.

The following code example demonstrates using the RawUrl property.

public static void CheckTestUrl(HttpListener listener, HttpListenerRequest request)
    if (request.RawUrl == "/")
        listener.Abort ();


Windows 98, Windows Server 2003, Windows XP Media Center Edition, Windows XP SP2, Windows XP Starter Edition

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

.NET Framework

Supported in: 2.0

Community Additions