Share via


HttpRequestMessageExtensions.CreateUnauthorizedResponse Method

Definition

Overloads

CreateUnauthorizedResponse(HttpRequestMessage)

Creates an System.Net.Http.HttpResponseMessage with an System.Net.HttpStatusCode.Unauthorized status code and a default System.Web.Http.HttpError as HTTP response body.

CreateUnauthorizedResponse(HttpRequestMessage, String, Object[])

Creates an System.Net.Http.HttpResponseMessage with an System.Net.HttpStatusCode.Unauthorized status code and a System.Web.Http.HttpError containing the provided message as HTTP response body.

CreateUnauthorizedResponse(HttpRequestMessage)

Creates an System.Net.Http.HttpResponseMessage with an System.Net.HttpStatusCode.Unauthorized status code and a default System.Web.Http.HttpError as HTTP response body.

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", Justification="Parameters are validated by Create due to how extension methods are resolved.")]
public static System.Net.Http.HttpResponseMessage CreateUnauthorizedResponse(this System.Net.Http.HttpRequestMessage request);
[<System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", Justification="Parameters are validated by Create due to how extension methods are resolved.")>]
static member CreateUnauthorizedResponse : System.Net.Http.HttpRequestMessage -> System.Net.Http.HttpResponseMessage
<Extension()>
Public Function CreateUnauthorizedResponse (request As HttpRequestMessage) As HttpResponseMessage

Parameters

request
System.Net.Http.HttpRequestMessage

The current System.Net.Http.HttpRequestMessage.

Returns

System.Net.Http.HttpResponseMessage

An initialized System.Net.Http.HttpResponseMessage.

Attributes
System.Diagnostics.CodeAnalysis.SuppressMessageAttribute

Applies to

CreateUnauthorizedResponse(HttpRequestMessage, String, Object[])

Creates an System.Net.Http.HttpResponseMessage with an System.Net.HttpStatusCode.Unauthorized status code and a System.Web.Http.HttpError containing the provided message as HTTP response body.

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", Justification="Parameters are validated by Create due to how extension methods are resolved.")]
public static System.Net.Http.HttpResponseMessage CreateUnauthorizedResponse(this System.Net.Http.HttpRequestMessage request, string format, params object[] args);
[<System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", Justification="Parameters are validated by Create due to how extension methods are resolved.")>]
static member CreateUnauthorizedResponse : System.Net.Http.HttpRequestMessage * string * obj[] -> System.Net.Http.HttpResponseMessage
<Extension()>
Public Function CreateUnauthorizedResponse (request As HttpRequestMessage, format As String, ParamArray args As Object()) As HttpResponseMessage

Parameters

request
System.Net.Http.HttpRequestMessage

The current System.Net.Http.HttpRequestMessage.

format
System.String

A composite format string.

args
System.Object[]

An object array that contains zero or more objects to format.

Returns

System.Net.Http.HttpResponseMessage

An initialized System.Net.Http.HttpResponseMessage.

Attributes
System.Diagnostics.CodeAnalysis.SuppressMessageAttribute

Applies to