HttpRequestMessageExtensions Class

Definition

Provides extension methods for the HttpRequestMessage class.

public static class HttpRequestMessageExtensions
type HttpRequestMessageExtensions = class
Public Module HttpRequestMessageExtensions
Inheritance
HttpRequestMessageExtensions

Methods

CreateErrorResponse(HttpRequestMessage, HttpStatusCode, Exception)

Helper method that performs content negotiation and creates a HttpResponseMessage representing an error with an instance of System.Net.Http.ObjectContent`1 wrapping an HttpError for exception exception. If no formatter is found, this method returns a response with status 406 NotAcceptable.

CreateErrorResponse(HttpRequestMessage, HttpStatusCode, HttpError)

Helper method that performs content negotiation and creates a HttpResponseMessage representing an error with an instance of System.Net.Http.ObjectContent`1 wrapping error as the content. If no formatter is found, this method returns a response with status 406 NotAcceptable.

CreateErrorResponse(HttpRequestMessage, HttpStatusCode, ModelStateDictionary)

Helper method that performs content negotiation and creates a HttpResponseMessage representing an error with an instance of System.Net.Http.ObjectContent`1 wrapping an HttpError for model state modelState. If no formatter is found, this method returns a response with status 406 NotAcceptable.

CreateErrorResponse(HttpRequestMessage, HttpStatusCode, String)

Helper method that performs content negotiation and creates a HttpResponseMessage representing an error with an instance of System.Net.Http.ObjectContent`1 wrapping an HttpError with message message. If no formatter is found, this method returns a response with status 406 NotAcceptable.

CreateErrorResponse(HttpRequestMessage, HttpStatusCode, String, Exception)

Helper method that performs content negotiation and creates a HttpResponseMessage representing an error with an instance of System.Net.Http.ObjectContent`1 wrapping an HttpError with error message message for exception exception. If no formatter is found, this method returns a response with status 406 NotAcceptable.

CreateResponse<T>(HttpRequestMessage, HttpStatusCode, T)

Helper method that performs content negotiation and creates a HttpResponseMessage with an instance of System.Net.Http.ObjectContent`1 as the content if a formatter can be found. If no formatter is found, this method returns a response with status 406 NotAcceptable. configuration.

CreateResponse<T>(HttpRequestMessage, HttpStatusCode, T, IEnumerable<MediaTypeFormatter>)

Helper method that performs content negotiation and creates a HttpResponseMessage with an instance of System.Net.Http.ObjectContent`1 as the content if a formatter can be found. If no formatter is found, this method returns a response with status 406 NotAcceptable.

CreateResponse<T>(HttpRequestMessage, HttpStatusCode, T, MediaTypeFormatter)

Helper method that creates a HttpResponseMessage with an System.Net.Http.ObjectContent`1 instance containing the provided value and the given formatter.

CreateResponse<T>(HttpRequestMessage, HttpStatusCode, T, MediaTypeFormatter, MediaTypeHeaderValue)

Helper method that creates a HttpResponseMessage with an System.Net.Http.ObjectContent`1 instance containing the provided value and the given formatter.

CreateResponse<T>(HttpRequestMessage, HttpStatusCode, T, MediaTypeFormatter, String)

Helper method that creates a HttpResponseMessage with an System.Net.Http.ObjectContent`1 instance containing the provided value and the given formatter.

CreateResponse<T>(HttpRequestMessage, HttpStatusCode, T, MediaTypeHeaderValue)

Helper method that creates a HttpResponseMessage with an System.Net.Http.ObjectContent`1 instance containing the provided value. The given mediaType is used to find an instance of System.Net.Http.Formatting.MediaTypeFormatter.

CreateResponse<T>(HttpRequestMessage, HttpStatusCode, T, String)

Helper method that creates a HttpResponseMessage with an System.Net.Http.ObjectContent`1 instance containing the provided value. The given mediaType is used to find an instance of System.Net.Http.Formatting.MediaTypeFormatter.

CreateResponse<T>(HttpRequestMessage, T)

Helper method that performs content negotiation and creates a HttpResponseMessage with an instance of System.Net.Http.ObjectContent`1 as the content and OK as the status code if a formatter can be found. If no formatter is found, this method returns a response with status 406 NotAcceptable.

Applies to