View Source
Class HttpRequestExtensions
Extension methods for Microsoft.AspNetCore.Http.HttpRequest
Inheritance
System.Object
Assembly: Umbraco.Web.Common.dll
Syntax
public static class HttpRequestExtensions
Methods
View Source
ClientCulture(HttpRequest)
Declaration
public static string ClientCulture(this HttpRequest request)
Parameters
Type |
Name |
Description |
Microsoft.AspNetCore.Http.HttpRequest |
request |
|
Returns
Type |
Description |
System.String |
|
View Source
GetApplicationUri(HttpRequest, WebRoutingSettings)
Gets the application URI, will use the one specified in settings if present
Declaration
public static Uri GetApplicationUri(this HttpRequest request, WebRoutingSettings routingSettings)
Parameters
Type |
Name |
Description |
Microsoft.AspNetCore.Http.HttpRequest |
request |
|
WebRoutingSettings |
routingSettings |
|
Returns
View Source
GetRawBodyString(HttpRequest, Encoding)
Declaration
public static string GetRawBodyString(this HttpRequest request, Encoding encoding = null)
Parameters
Type |
Name |
Description |
Microsoft.AspNetCore.Http.HttpRequest |
request |
|
System.Text.Encoding |
encoding |
|
Returns
Type |
Description |
System.String |
|
View Source
GetRawBodyStringAsync(HttpRequest, Encoding)
Declaration
public static async Task<string> GetRawBodyStringAsync(this HttpRequest request, Encoding encoding = null)
Parameters
Type |
Name |
Description |
Microsoft.AspNetCore.Http.HttpRequest |
request |
|
System.Text.Encoding |
encoding |
|
Returns
Type |
Description |
Task<System.String> |
|
View Source
GetUfprt(HttpRequest)
Gets the Umbraco ufprt
encrypted string from the current request
Declaration
public static string GetUfprt(this HttpRequest request)
Parameters
Type |
Name |
Description |
Microsoft.AspNetCore.Http.HttpRequest |
request |
The current request
|
Returns
Type |
Description |
System.String |
The extracted ufprt token.
|
View Source
HasPreviewCookie(HttpRequest)
Check if a preview cookie exist
Declaration
public static bool HasPreviewCookie(this HttpRequest request)
Parameters
Type |
Name |
Description |
Microsoft.AspNetCore.Http.HttpRequest |
request |
|
Returns
Type |
Description |
System.Boolean |
|
View Source
IsBackOfficeRequest(HttpRequest)
Returns true if the request is a back office request
Declaration
public static bool IsBackOfficeRequest(this HttpRequest request)
Parameters
Type |
Name |
Description |
Microsoft.AspNetCore.Http.HttpRequest |
request |
|
Returns
Type |
Description |
System.Boolean |
|
View Source
IsClientSideRequest(HttpRequest)
Returns true if the request is for a client side extension
Declaration
public static bool IsClientSideRequest(this HttpRequest request)
Parameters
Type |
Name |
Description |
Microsoft.AspNetCore.Http.HttpRequest |
request |
|
Returns
Type |
Description |
System.Boolean |
|
View Source
IsLocal(HttpRequest)
Determines if a request is local.
Declaration
public static bool IsLocal(this HttpRequest request)
Parameters
Type |
Name |
Description |
Microsoft.AspNetCore.Http.HttpRequest |
request |
|
Returns
Type |
Description |
System.Boolean |
True if request is local
|