Interface IPublishedRequest
The result of Umbraco routing built with the IPublishedRequestBuilder
Namespace: Umbraco.Cms.Core.Routing
Assembly: Umbraco.Core.dll
Syntax
public interface IPublishedRequest
Properties
View SourceAbsolutePathDecoded
Gets the URI decoded absolute path of the Uri
Declaration
string AbsolutePathDecoded { get; }
Property Value
Type | Description |
---|---|
System.String |
CacheExtensions
Gets a list of Extensions to append to the Response.Cache object.
Declaration
IReadOnlyList<string>? CacheExtensions { get; }
Property Value
Type | Description |
---|---|
System.Nullable<IReadOnlyList<System.String>> |
Culture
Gets the content request's culture.
Declaration
string Culture { get; }
Property Value
Type | Description |
---|---|
System.String |
Remarks
This will get mapped to a CultureInfo eventually but CultureInfo are expensive to create so we want to leave that up to the localization middleware to do. See https://github.com/dotnet/aspnetcore/blob/b795ac3546eb3e2f47a01a64feb3020794ca33bb/src/Middleware/Localization/src/RequestLocalizationMiddleware.cs#L165.
Domain
Gets the content request's domain.
Declaration
DomainAndUri Domain { get; }
Property Value
Type | Description |
---|---|
DomainAndUri |
Remarks
Is a DomainAndUri object ie a standard Domain plus the fully qualified uri. For example,
the Domain
may contain "example.com" whereas the Uri
will be fully qualified eg
"http://example.com/".
Headers
Gets a dictionary of Headers to append to the Response object.
Declaration
IReadOnlyDictionary<string, string>? Headers { get; }
Property Value
Type | Description |
---|---|
System.Nullable<IReadOnlyDictionary<System.String, System.String>> |
IgnorePublishedContentCollisions
Gets a value indicating whether the Umbraco Backoffice should ignore a collision for this request.
Declaration
bool IgnorePublishedContentCollisions { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Remarks
This is an uncommon API used for edge cases with complex routing and would be used
by developers to configure the request to disable collision checks in
This flag is based on previous Umbraco versions but it is not clear how this flag can be set by developers
since
collission checking only occurs in the back office which is launched by
More can be read about this setting here: https://github.com/umbraco/Umbraco-CMS/pull/2148, https://issues.umbraco.org/issue/U4-10345 but it's still unclear how this was used.
IsInternalRedirect
Gets a value indicating whether the current published content has been obtained from the initial published content following internal redirections exclusively.
Declaration
bool IsInternalRedirect { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Remarks
Used by PublishedContentRequestEngine.FindTemplate() to figure out whether to apply the internal redirect or not, when content is not the initial content.
PublishedContent
Gets a value indicating the requested content.
Declaration
IPublishedContent PublishedContent { get; }
Property Value
Type | Description |
---|---|
IPublishedContent |
RedirectUrl
Gets the url to redirect to, when the content request triggers a redirect.
Declaration
string RedirectUrl { get; }
Property Value
Type | Description |
---|---|
System.String |
ResponseStatusCode
Gets the content request http response status code.
Declaration
int? ResponseStatusCode { get; }
Property Value
Type | Description |
---|---|
System.Nullable<System.Int32> |
Remarks
Does not actually set the http response status code, only registers that the response should use the specified code. The code will or will not be used, in due time.
SetNoCacheHeader
Gets a value indicating whether the no-cache value should be added to the Cache-Control header
Declaration
bool SetNoCacheHeader { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Template
Gets the template assigned to the request (if any)
Declaration
ITemplate Template { get; }
Property Value
Type | Description |
---|---|
ITemplate |
Uri
Gets the cleaned up inbound Uri used for routing.
Declaration
Uri Uri { get; }
Property Value
Type | Description |
---|---|
Uri |
Remarks
The cleaned up Uri has no virtual directory, no trailing slash, no .aspx extension, etc.