HttpRequestMessage<T> Class

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Derived HttpRequestMessage class that contains a strongly typed object as its content.

Inheritance Hierarchy

System.Object
  System.Net.Http.HttpRequestMessage
    System.Net.Http.HttpRequestMessage<T>

Namespace:  System.Net.Http
Assembly:  System.Net.Http.Formatting (in System.Net.Http.Formatting.dll)

Syntax

'Declaration
Public Class HttpRequestMessage(Of T) _
    Inherits HttpRequestMessage
public class HttpRequestMessage<T> : HttpRequestMessage
generic<typename T>
public ref class HttpRequestMessage : public HttpRequestMessage
type HttpRequestMessage<'T> =  
    class
        inherit HttpRequestMessage
    end
JScript does not support generic types or methods.

Type Parameters

  • T
    The type of object it contains as its content.

The HttpRequestMessage<T> type exposes the following members.

Constructors

  Name Description
Public method HttpRequestMessage<T>() Initializes a new instance of the <see cref="T:System.Net.Http.HttpRequestMessage`1" /> class.
Public method HttpRequestMessage<T>(T) Initializes a new instance of the <see cref="T:System.Net.Http.HttpRequestMessage`1" /> class.
Public method HttpRequestMessage<T>(T, IEnumerable<MediaTypeFormatter>) Initializes a new instance of the <see cref="T:System.Net.Http.HttpRequestMessage`1" /> class.
Public method HttpRequestMessage<T>(T, MediaTypeHeaderValue) Initializes a new instance of the <see cref="T:System.Net.Http.HttpRequestMessage`1" /> class.
Public method HttpRequestMessage<T>(T, String) Initializes a new instance of the <see cref="T:System.Net.Http.HttpRequestMessage`1" /> class.
Public method HttpRequestMessage<T>(T, MediaTypeHeaderValue, IEnumerable<MediaTypeFormatter>) Initializes a new instance of the <see cref="T:System.Net.Http.HttpRequestMessage`1" /> class.
Public method HttpRequestMessage<T>(T, MediaTypeHeaderValue, IEnumerable<MediaTypeFormatter>, IFormatterSelector) Initializes a new instance of the <see cref="T:System.Net.Http.HttpRequestMessage`1" /> class.
Public method HttpRequestMessage<T>(T, HttpMethod, Uri, IEnumerable<MediaTypeFormatter>) Initializes a new instance of the <see cref="T:System.Net.Http.HttpRequestMessage`1" /> class.

Top

Properties

  Name Description
Public property Content Gets or sets the ObjectContent that manages the object value for this HttpRequestMessage.
Public property Headers Gets the collection of HTTP request headers. (Inherited from HttpRequestMessage.)
Public property Method Gets or sets the HTTP method used by the HTTP request message. (Inherited from HttpRequestMessage.)
Public property Properties Gets a set of properties for the HTTP request. (Inherited from HttpRequestMessage.)
Public property RequestUri Gets or sets the Uri used for the HTTP request. (Inherited from HttpRequestMessage.)
Public property Version Gets or sets the HTTP message version. (Inherited from HttpRequestMessage.)

Top

Methods

  Name Description
Public method Dispose() Releases the unmanaged resources and disposes of the managed resources used by the HttpRequestMessage. (Inherited from HttpRequestMessage.)
Protected method Dispose(Boolean) Releases the unmanaged resources used by the HttpRequestMessage and optionally disposes of the managed resources. (Inherited from HttpRequestMessage.)
Public method Equals Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public method GetHashCode Serves as a hash function for a particular type. (Inherited from Object.)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public method ToString Returns a string that represents the current object. (Inherited from HttpRequestMessage.)

Top

Extension Methods

  Name Description
Public Extension Method CreateContent(Type, Object) Overloaded. Creates a new ObjectContent instance associated with the given HttpRequestMessage. (Defined by HttpRequestMessageExtensions.)
Public Extension Method CreateContent(Type, Object, IEnumerable<MediaTypeFormatter>, IFormatterSelector) Overloaded. Creates a new ObjectContent instance associated with the given HttpRequestMessage. (Defined by HttpRequestMessageExtensions.)
Public Extension Method CreateContent(Type, Object, MediaTypeHeaderValue, IEnumerable<MediaTypeFormatter>, IFormatterSelector) Overloaded. Creates a new ObjectContent instance associated with the given HttpRequestMessage. (Defined by HttpRequestMessageExtensions.)
Public Extension Method CreateContent<T>(T) Overloaded. Creates a new ObjectContent instance associated with the given HttpRequestMessage. (Defined by HttpRequestMessageExtensions.)
Public Extension Method CreateContent<T>(T, IEnumerable<MediaTypeFormatter>, IFormatterSelector) Overloaded. Creates a new ObjectContent instance associated with the given HttpRequestMessage. (Defined by HttpRequestMessageExtensions.)
Public Extension Method CreateContent<T>(T, MediaTypeHeaderValue, IEnumerable<MediaTypeFormatter>, IFormatterSelector) Overloaded. Creates a new ObjectContent instance associated with the given HttpRequestMessage. (Defined by HttpRequestMessageExtensions.)
Public Extension Method CreateResponse() Overloaded. Creates the HttpResponseMessage wired up to the associated HttpRequestMessage. (Defined by HttpRequestMessageCommonExtensions.)
Public Extension Method CreateResponse(HttpStatusCode) Overloaded. Creates the HttpResponseMessage wired up to the associated HttpRequestMessage. (Defined by HttpRequestMessageCommonExtensions.)
Public Extension Method GetConfiguration Retrieves the HttpConfiguration for the given request. (Defined by HttpRequestMessageExtensions.)
Public Extension Method GetRouteData Retrieves the IHttpRouteData for the given request or **null** if not available. (Defined by HttpRequestMessageExtensions.)
Public Extension Method GetSynchronizationContext Retrieves the SynchronizationContext for the given request or **null** if not available. (Defined by HttpRequestMessageExtensions.)
Public Extension Method GetUserPrincipal Retrieves the IPrincipal for the given request or **null** if not available. (Defined by HttpRequestMessageExtensions.)

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