View Source
Class HttpRequestMessageExtensions
Inheritance
System.Object
Assembly: Umbraco.Web.dll
Syntax
public static class HttpRequestMessageExtensions
Methods
View Source
CreateNotificationSuccessResponse(HttpRequestMessage, String)
Creates a successful response with notifications in the result to be displayed in the UI
Declaration
public static HttpResponseMessage CreateNotificationSuccessResponse(this HttpRequestMessage request, string successMessage)
Parameters
Type |
Name |
Description |
HttpRequestMessage |
request |
|
System.String |
successMessage |
|
Returns
Type |
Description |
HttpResponseMessage |
|
View Source
CreateNotificationValidationErrorResponse(HttpRequestMessage, String)
Creates an error response with notifications in the result to be displayed in the UI
Declaration
public static HttpResponseMessage CreateNotificationValidationErrorResponse(this HttpRequestMessage request, string errorMessage)
Parameters
Type |
Name |
Description |
HttpRequestMessage |
request |
|
System.String |
errorMessage |
|
Returns
Type |
Description |
HttpResponseMessage |
|
View Source
CreateUserNoAccessResponse(HttpRequestMessage)
Create a 403 (Forbidden) response indicating that the current user doesn't have access to the resource
requested or the action it needs to take.
Declaration
public static HttpResponseMessage CreateUserNoAccessResponse(this HttpRequestMessage request)
Parameters
Type |
Name |
Description |
HttpRequestMessage |
request |
|
Returns
Type |
Description |
HttpResponseMessage |
|
View Source
CreateValidationErrorResponse(HttpRequestMessage)
Create a 400 response message indicating that a validation error occurred
Declaration
public static HttpResponseMessage CreateValidationErrorResponse(this HttpRequestMessage request)
Parameters
Type |
Name |
Description |
HttpRequestMessage |
request |
|
Returns
Type |
Description |
HttpResponseMessage |
|
View Source
CreateValidationErrorResponse(HttpRequestMessage, ModelStateDictionary)
Create a 400 response message indicating that a validation error occurred
Declaration
public static HttpResponseMessage CreateValidationErrorResponse(this HttpRequestMessage request, ModelStateDictionary modelState)
Parameters
Type |
Name |
Description |
HttpRequestMessage |
request |
|
ModelStateDictionary |
modelState |
|
Returns
Type |
Description |
HttpResponseMessage |
|
View Source
CreateValidationErrorResponse(HttpRequestMessage, String)
Create a 400 response message indicating that a validation error occurred
Declaration
public static HttpResponseMessage CreateValidationErrorResponse(this HttpRequestMessage request, string errorMessage)
Parameters
Type |
Name |
Description |
HttpRequestMessage |
request |
|
System.String |
errorMessage |
|
Returns
Type |
Description |
HttpResponseMessage |
|
View Source
CreateValidationErrorResponse<T>(HttpRequestMessage, T)
Create a 400 response message indicating that a validation error occurred
Declaration
public static HttpResponseMessage CreateValidationErrorResponse<T>(this HttpRequestMessage request, T value)
Parameters
Type |
Name |
Description |
HttpRequestMessage |
request |
|
T |
value |
|
Returns
Type |
Description |
HttpResponseMessage |
|
Type Parameters
View Source
TryGetHttpContext(HttpRequestMessage)
Tries to retrieve the current HttpContext if one exists.
Declaration
public static Attempt<HttpContextBase> TryGetHttpContext(this HttpRequestMessage request)
Parameters
Type |
Name |
Description |
HttpRequestMessage |
request |
|
Returns
Type |
Description |
Attempt<System.Web.HttpContextBase> |
|