Skip to content

Files

Latest commit

 

History

History

uri-helper

Uri Helper (5)

This section shows various methods available at Microsoft.AspNetCore.Http.Extensions.UriHelper.

  • Get Display Url

    Request.GetDisplayUrl() shows complete url with host, path and query string of the current request. It's to be used for display purposes only.

  • Get Encoded Url

    Request.GetEncodedUrl() returns the combined components of the request URL in a fully escaped form suitable for use in HTTP headers and other HTTP operations.

  • Get Encoded Path and Query

    UriHelper.GetEncodedPathAndQuery returns the relative URL of a request.

  • From Absolute

    UriHelper.FromAbsolute separates the given absolute URI string into components.

  • Build Absolute

    UriHelper.BuildAbsolute combines the given URI components into a string that is properly encoded for use in HTTP headers. This sample shows 9 ways on how to use it.

dotnet8