Freigeben über


HttpRequestMessageExtensions Class

Provides extension methods for HttpRequestMessage.

Inheritance Hierarchy

System.Object
  System.Net.Http.HttpRequestMessageExtensions

Namespace:  System.Net.Http
Assemblies:   System.Web.Http.SelfHost (in System.Web.Http.SelfHost.dll)
  System.Web.Http (in System.Web.Http.dll)
  System.Net.Http.Formatting (in System.Net.Http.Formatting.dll)

Syntax

'Declaration
<ExtensionAttribute> _
Public NotInheritable Class HttpRequestMessageExtensions
'Usage
public static class HttpRequestMessageExtensions
[ExtensionAttribute]
public ref class HttpRequestMessageExtensions abstract sealed
[<AbstractClassAttribute>]
[<SealedAttribute>]
type HttpRequestMessageExtensions =  class end
public final class HttpRequestMessageExtensions

The HttpRequestMessageExtensions type exposes the following members.

Methods

  Name Description
Public methodStatic member CreateErrorResponse(HttpRequestMessage, InvalidByteRangeException)
Public methodStatic member CreateErrorResponse(HttpRequestMessage, HttpStatusCode, Exception) Creates an HttpResponseMessage that represents an exception.
Public methodStatic member CreateErrorResponse(HttpRequestMessage, HttpStatusCode, String) Creates an HttpResponseMessage that represents an error message.
Public methodStatic member CreateErrorResponse(HttpRequestMessage, HttpStatusCode, HttpError) Creates an HttpResponseMessage that represents an error.
Public methodStatic member CreateErrorResponse(HttpRequestMessage, HttpStatusCode, ModelStateDictionary) Creates an HttpResponseMessage that represents an error in the model state.
Public methodStatic member CreateErrorResponse(HttpRequestMessage, HttpStatusCode, String, Exception) Creates an HttpResponseMessage that represents an exception with an error message.
Public methodStatic member CreateResponse(HttpRequestMessage)
Public methodStatic member CreateResponse(HttpRequestMessage, HttpStatusCode)
Public methodStatic member CreateResponse<T>(HttpRequestMessage, HttpStatusCode, T) Creates an HttpResponseMessage wired up to the associated HttpRequestMessage.
Public methodStatic member CreateResponse<T>(HttpRequestMessage, HttpStatusCode, T, MediaTypeFormatter) Creates an HttpResponseMessage wired up to the associated HttpRequestMessage.
Public methodStatic member CreateResponse<T>(HttpRequestMessage, HttpStatusCode, T, MediaTypeHeaderValue) Creates an HttpResponseMessage wired up to the associated HttpRequestMessage.
Public methodStatic member CreateResponse<T>(HttpRequestMessage, HttpStatusCode, T, String) Creates an HttpResponseMessage wired up to the associated HttpRequestMessage.
Public methodStatic member CreateResponse<T>(HttpRequestMessage, HttpStatusCode, T, HttpConfiguration) Creates an HttpResponseMessage wired up to the associated HttpRequestMessage.
Public methodStatic member CreateResponse<T>(HttpRequestMessage, HttpStatusCode, T, MediaTypeFormatter, MediaTypeHeaderValue) Creates an HttpResponseMessage wired up to the associated HttpRequestMessage.
Public methodStatic member CreateResponse<T>(HttpRequestMessage, HttpStatusCode, T, MediaTypeFormatter, String) Creates an HttpResponseMessage wired up to the associated HttpRequestMessage.
Public methodStatic member DisposeRequestResources Disposes of all tracked resources associated with the request which were added via the RegisterForDispose method.
Public methodStatic member GetClientCertificate Gets the current X.509 certificate from the given HTTP request.
Public methodStatic member GetConfiguration Retrieves the HttpConfiguration for the given request.
Public methodStatic member GetCorrelationId Retrieves the Guid which has been assigned as the correlation ID associated with the given request. The value will be created and set the first time this method is called.
Public methodStatic member GetDependencyScope Retrieves the IDependencyScope for the given request or null reference (Nothing in Visual Basic) if not available.
Public methodStatic member GetQueryNameValuePairs Gets the parsed query string as a collection of key-value pairs.
Public methodStatic member GetRouteData Retrieves the IHttpRouteData for the given request or null reference (Nothing in Visual Basic) if not available.
Public methodStatic member GetSecurityMessageProperty Gets the current SecurityMessageProperty stored in the request message properties for the given request.
Public methodStatic member GetSynchronizationContext Retrieves the SynchronizationContext for the given request or null reference (Nothing in Visual Basic) if not available.
Public methodStatic member GetUrlHelper Gets a UrlHelper instance for an HTTP request.
Public methodStatic member RegisterForDispose Adds the given resource to a list of resources that will be disposed by a host once the request is disposed.

Top

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

System.Net.Http Namespace