{"id":86,"date":"2009-03-20T11:45:00","date_gmt":"2009-03-20T11:45:00","guid":{"rendered":"https:\/\/wdev-blog.azurewebsites.net\/index.php\/2009\/03\/20\/url-properties-of-request-to-asp-net\/"},"modified":"2009-03-20T11:45:00","modified_gmt":"2009-03-20T11:45:00","slug":"url-properties-of-request-to-asp-net","status":"publish","type":"post","link":"http:\/\/panahy.nl\/index.php\/2009\/03\/20\/url-properties-of-request-to-asp-net\/","title":{"rendered":"URL properties of Request to ASP.NET"},"content":{"rendered":"<p>The following attributes are some of the usefull properties of the URL object. I use the following url to send my request to localhost:<\/p>\n<p><code><br \/>http:\/\/localhost\/Test\/Asghar.aspx?test=fine<br \/><\/code><\/p>\n<p>And I get the following results:<br \/><code><br \/>AbsolutePath = \/Test\/Asghar.aspx<br \/>AbsoluteUri = http:\/\/localhost\/Test\/Asghar.aspx?test=fine<br \/>Authority = localhost<br \/>DnsSafeHost = localhost<br \/>Fragment =<br \/>Host = localhost<br \/>HostNameType= Dns<br \/>IsAbsoluteUri = True<br \/>IsFile = False<br \/>LocalPath = \/Test\/Asghar.aspx<br \/>OriginalString = http:\/\/localhost:80\/Test\/Asghar.aspx?test=fine<br \/>PathAndQuery = \/Test\/Asghar.aspx?test=fine<br \/>Port = 80<br \/>Query = ?test=fine<br \/>Scheme = http<br \/>UserEscaped = False<br \/>UserInfo =<br \/><\/code><br \/>And the code to do it is as followes:<br \/><code><\/code><\/p>\n<pre>    AbsolutePath = &lt;%= System.Web.HttpContext.Current.Request.Url.AbsolutePath %&gt;&lt;br \/&gt;<br\/>     AbsoluteUri = &lt;%= System.Web.HttpContext.Current.Request.Url.AbsoluteUri %&gt;&lt;br \/&gt;<br\/>     Authority = &lt;%= System.Web.HttpContext.Current.Request.Url.Authority %&gt;&lt;br \/&gt;<br\/>     DnsSafeHost = &lt;%= System.Web.HttpContext.Current.Request.Url.DnsSafeHost %&gt;&lt;br \/&gt;<br\/>     Fragment = &lt;%= System.Web.HttpContext.Current.Request.Url.Fragment %&gt;&lt;br \/&gt;<br\/>     Host = &lt;%= System.Web.HttpContext.Current.Request.Url.Host %&gt;&lt;br \/&gt;<br\/>     HostNameType= &lt;%= System.Web.HttpContext.Current.Request.Url.HostNameType.ToString() %&gt;&lt;br \/&gt;<br\/>     IsAbsoluteUri = &lt;%= System.Web.HttpContext.Current.Request.Url.IsAbsoluteUri %&gt;&lt;br \/&gt;<br\/>     IsFile = &lt;%= System.Web.HttpContext.Current.Request.Url.IsFile %&gt;&lt;br \/&gt;<br\/>     LocalPath = &lt;%= System.Web.HttpContext.Current.Request.Url.LocalPath %&gt;&lt;br \/&gt;<br\/>     OriginalString  = &lt;%= System.Web.HttpContext.Current.Request.Url.OriginalString  %&gt;&lt;br \/&gt;<br\/>     PathAndQuery = &lt;%= System.Web.HttpContext.Current.Request.Url.PathAndQuery %&gt;&lt;br \/&gt;<br\/>     Port = &lt;%= System.Web.HttpContext.Current.Request.Url.Port %&gt;&lt;br \/&gt;<br\/>     Query = &lt;%= System.Web.HttpContext.Current.Request.Url.Query %&gt;&lt;br \/&gt;<br\/>     Scheme = &lt;%= System.Web.HttpContext.Current.Request.Url.Scheme %&gt;&lt;br \/&gt;<br\/>     UserEscaped = &lt;%= System.Web.HttpContext.Current.Request.Url.UserEscaped %&gt;&lt;br \/&gt;<br\/>     UserInfo = &lt;%= System.Web.HttpContext.Current.Request.Url.UserInfo %&gt;&lt;br \/&gt;<br\/> &lt;hr \/&gt;<br\/><br \/><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>The following attributes are some of the usefull properties of the URL object. I use the following url to send my request to localhost: http:\/\/localhost\/Test\/Asghar.aspx?test=fine And I get the following results:AbsolutePath = \/Test\/Asghar.aspxAbsoluteUri = http:\/\/localhost\/Test\/Asghar.aspx?test=fineAuthority = localhostDnsSafeHost = localhostFragment =Host = localhostHostNameType= DnsIsAbsoluteUri = TrueIsFile = FalseLocalPath = \/Test\/Asghar.aspxOriginalString = http:\/\/localhost:80\/Test\/Asghar.aspx?test=finePathAndQuery = \/Test\/Asghar.aspx?test=finePort = 80Query &hellip; <a href=\"http:\/\/panahy.nl\/index.php\/2009\/03\/20\/url-properties-of-request-to-asp-net\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;URL properties of Request to ASP.NET&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[34],"tags":[],"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false,"post-thumbnail":false},"uagb_author_info":{"display_name":"Pouya Panahy","author_link":"http:\/\/panahy.nl\/index.php\/author\/pouya\/"},"uagb_comment_info":6,"uagb_excerpt":"The following attributes are some of the usefull properties of the URL object. I use the following url to send my request to localhost: http:\/\/localhost\/Test\/Asghar.aspx?test=fine And I get the following results:AbsolutePath = \/Test\/Asghar.aspxAbsoluteUri = http:\/\/localhost\/Test\/Asghar.aspx?test=fineAuthority = localhostDnsSafeHost = localhostFragment =Host = localhostHostNameType= DnsIsAbsoluteUri = TrueIsFile = FalseLocalPath = \/Test\/Asghar.aspxOriginalString = http:\/\/localhost:80\/Test\/Asghar.aspx?test=finePathAndQuery = \/Test\/Asghar.aspx?test=finePort = 80Query&hellip;","_links":{"self":[{"href":"http:\/\/panahy.nl\/index.php\/wp-json\/wp\/v2\/posts\/86"}],"collection":[{"href":"http:\/\/panahy.nl\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/panahy.nl\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/panahy.nl\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/panahy.nl\/index.php\/wp-json\/wp\/v2\/comments?post=86"}],"version-history":[{"count":0,"href":"http:\/\/panahy.nl\/index.php\/wp-json\/wp\/v2\/posts\/86\/revisions"}],"wp:attachment":[{"href":"http:\/\/panahy.nl\/index.php\/wp-json\/wp\/v2\/media?parent=86"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/panahy.nl\/index.php\/wp-json\/wp\/v2\/categories?post=86"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/panahy.nl\/index.php\/wp-json\/wp\/v2\/tags?post=86"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}