HttpRequestMessageExtensions.CreateBadRequestResponse Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| CreateBadRequestResponse(HttpRequestMessage) |
Creates an System.Net.Http.HttpResponseMessage with an System.Net.HttpStatusCode.BadRequest status code and a default System.Web.Http.HttpError as HTTP response body. |
| CreateBadRequestResponse(HttpRequestMessage, String, Object[]) |
Creates an System.Net.Http.HttpResponseMessage with an System.Net.HttpStatusCode.BadRequest status code and a System.Web.Http.HttpError containing the provided message as HTTP response body. |
CreateBadRequestResponse(HttpRequestMessage)
Creates an System.Net.Http.HttpResponseMessage with an System.Net.HttpStatusCode.BadRequest 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 CreateBadRequestResponse(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 CreateBadRequestResponse : System.Net.Http.HttpRequestMessage -> System.Net.Http.HttpResponseMessage
<Extension()>
Public Function CreateBadRequestResponse (request As HttpRequestMessage) As HttpResponseMessage
Parameters
- request
- System.Net.Http.HttpRequestMessage
The current System.Net.Http.HttpRequestMessage.
Returns
An initialized System.Net.Http.HttpResponseMessage.
- Attributes
-
System.Diagnostics.CodeAnalysis.SuppressMessageAttribute
Applies to
CreateBadRequestResponse(HttpRequestMessage, String, Object[])
Creates an System.Net.Http.HttpResponseMessage with an System.Net.HttpStatusCode.BadRequest 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 CreateBadRequestResponse(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 CreateBadRequestResponse : System.Net.Http.HttpRequestMessage * string * obj[] -> System.Net.Http.HttpResponseMessage
<Extension()>
Public Function CreateBadRequestResponse (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
An initialized System.Net.Http.HttpResponseMessage.
- Attributes
-
System.Diagnostics.CodeAnalysis.SuppressMessageAttribute