@@ -16,12 +16,12 @@ public static class UriHelper
16
16
/// <summary>
17
17
/// Combines the given URI components into a string that is properly encoded for use in HTTP headers.
18
18
/// </summary>
19
- /// <param name="pathBase"></param>
20
- /// <param name="path"></param>
21
- /// <param name="query"></param>
22
- /// <param name="fragment"></param>
19
+ /// <param name="pathBase">The first portion of the request path associated with application root. </param>
20
+ /// <param name="path">The portion of the request path that identifies the requested resource. </param>
21
+ /// <param name="query">The query, if any. </param>
22
+ /// <param name="fragment">The fragment, if any. </param>
23
23
/// <returns></returns>
24
- public static string Encode (
24
+ public static string BuildRelative (
25
25
PathString pathBase = new PathString ( ) ,
26
26
PathString path = new PathString ( ) ,
27
27
QueryString query = new QueryString ( ) ,
@@ -35,14 +35,14 @@ public static string Encode(
35
35
/// Combines the given URI components into a string that is properly encoded for use in HTTP headers.
36
36
/// Note that unicode in the HostString will be encoded as punycode.
37
37
/// </summary>
38
- /// <param name="scheme"></param>
39
- /// <param name="host"></param>
40
- /// <param name="pathBase"></param>
41
- /// <param name="path"></param>
42
- /// <param name="query"></param>
43
- /// <param name="fragment"></param>
38
+ /// <param name="scheme">http, https, etc. </param>
39
+ /// <param name="host">The host portion of the uri normally included in the Host header. This may include the port. </param>
40
+ /// <param name="pathBase">The first portion of the request path associated with application root. </param>
41
+ /// <param name="path">The portion of the request path that identifies the requested resource. </param>
42
+ /// <param name="query">The query, if any. </param>
43
+ /// <param name="fragment">The fragment, if any. </param>
44
44
/// <returns></returns>
45
- public static string Encode (
45
+ public static string BuildAbsolute (
46
46
string scheme ,
47
47
HostString host ,
48
48
PathString pathBase = new PathString ( ) ,
@@ -74,13 +74,13 @@ public static string Encode(
74
74
/// Generates a string from the given absolute or relative Uri that is appropriately encoded for use in
75
75
/// HTTP headers. Note that a unicode host name will be encoded as punycode.
76
76
/// </summary>
77
- /// <param name="uri"></param>
77
+ /// <param name="uri">The Uri to encode. </param>
78
78
/// <returns></returns>
79
79
public static string Encode ( Uri uri )
80
80
{
81
81
if ( uri . IsAbsoluteUri )
82
82
{
83
- return Encode (
83
+ return BuildAbsolute (
84
84
scheme : uri . Scheme ,
85
85
host : HostString . FromUriComponent ( uri ) ,
86
86
pathBase : PathString . FromUriComponent ( uri ) ,
@@ -97,18 +97,18 @@ public static string Encode(Uri uri)
97
97
/// Returns the combined components of the request URL in a fully escaped form suitable for use in HTTP headers
98
98
/// and other HTTP operations.
99
99
/// </summary>
100
- /// <param name="request"></param>
100
+ /// <param name="request">The request to assemble the uri pieces from. </param>
101
101
/// <returns></returns>
102
102
public static string GetEncodedUrl ( this HttpRequest request )
103
103
{
104
- return Encode ( request . Scheme , request . Host , request . PathBase , request . Path , request . QueryString ) ;
104
+ return BuildAbsolute ( request . Scheme , request . Host , request . PathBase , request . Path , request . QueryString ) ;
105
105
}
106
106
107
107
/// <summary>
108
108
/// Returns the combined components of the request URL in a fully un-escaped form (except for the QueryString)
109
109
/// suitable only for display. This format should not be used in HTTP headers or other HTTP operations.
110
110
/// </summary>
111
- /// <param name="request"></param>
111
+ /// <param name="request">The request to assemble the uri pieces from. </param>
112
112
/// <returns></returns>
113
113
public static string GetDisplayUrl ( this HttpRequest request )
114
114
{
0 commit comments