HttpResponseMessage<T> Class

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

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

Inheritance Hierarchy

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

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

Syntax

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

Type Parameters

  • T
    The type of object instances of this class will contain as its content.

The HttpResponseMessage<T> type exposes the following members.

Constructors

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

Top

Properties

  Name Description
Public property Content Gets or sets the ObjectContent that manages the value for this instance.
Public property Headers Gets the collection of HTTP response headers. (Inherited from HttpResponseMessage.)
Public property IsSuccessStatusCode Gets a value that indicates if the HTTP response was successful. (Inherited from HttpResponseMessage.)
Public property ReasonPhrase Gets or sets the reason phrase which typically is sent by servers together with the status code. (Inherited from HttpResponseMessage.)
Public property RequestMessage Gets or sets the request message which led to this response message. (Inherited from HttpResponseMessage.)
Public property StatusCode Gets or sets the status code of the HTTP response. (Inherited from HttpResponseMessage.)
Public property Version Gets or sets the HTTP message version. (Inherited from HttpResponseMessage.)

Top

Methods

  Name Description
Public method Dispose() Releases the unmanaged resources and disposes of unmanaged resources used by the HttpResponseMessage. (Inherited from HttpResponseMessage.)
Protected method Dispose(Boolean) Releases the unmanaged resources used by the HttpResponseMessage and optionally disposes of the managed resources. (Inherited from HttpResponseMessage.)
Public method EnsureSuccessStatusCode Throws an exception if the IsSuccessStatusCode property for the HTTP response is false. (Inherited from HttpResponseMessage.)
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 HttpResponseMessage.)

Top

Extension Methods

  Name Description
Public Extension Method CreateContent(Type, Object) Overloaded. Creates a new ObjectContent instance associated with the given HttpResponseMessage. (Defined by HttpResponseMessageExtensions.)
Public Extension Method CreateContent(Type, Object, IEnumerable<MediaTypeFormatter>, IFormatterSelector) Overloaded. Creates a new ObjectContent instance associated with the given HttpResponseMessage. (Defined by HttpResponseMessageExtensions.)
Public Extension Method CreateContent(Type, Object, MediaTypeHeaderValue, IEnumerable<MediaTypeFormatter>, IFormatterSelector) Overloaded. Creates a new ObjectContent instance associated with the given HttpResponseMessage. (Defined by HttpResponseMessageExtensions.)
Public Extension Method CreateContent<T>(T) Overloaded. Creates a new ObjectContent instance associated with the given HttpResponseMessage. (Defined by HttpResponseMessageExtensions.)
Public Extension Method CreateContent<T>(T, IEnumerable<MediaTypeFormatter>, IFormatterSelector) Overloaded. Creates a new ObjectContent instance associated with the given HttpResponseMessage. (Defined by HttpResponseMessageExtensions.)
Public Extension Method CreateContent<T>(T, MediaTypeHeaderValue, IEnumerable<MediaTypeFormatter>, IFormatterSelector) Overloaded. Creates a new ObjectContent instance associated with the given HttpResponseMessage. (Defined by HttpResponseMessageExtensions.)
Public Extension Method TryGetObjectValue<T> (Defined by HttpResponseMessageExtensions.)
Public Extension Method TrySetObjectValue<T> (Defined by HttpResponseMessageExtensions.)

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