HttpResponseMessageProperty Class

 

Provides access to the HTTP response in order to access and respond to the additional information made available for requests over the HTTP protocol.

Namespace:   System.ServiceModel.Channels
Assembly:  System.ServiceModel (in System.ServiceModel.dll)

System::Object
  System.ServiceModel.Channels::HttpResponseMessageProperty

public ref class HttpResponseMessageProperty sealed : IMessageProperty

NameDescription
System_CAPS_pubmethodHttpResponseMessageProperty()

Initializes a new instance of the HttpResponseMessageProperty class.

NameDescription
System_CAPS_pubpropertyHeaders

Gets the HTTP headers from the HTTP response.

System_CAPS_pubpropertySystem_CAPS_staticName

Gets the name of the message property associated with the HttpResponseMessageProperty class.

System_CAPS_pubpropertyStatusCode

Gets or sets the status code of the current HTTP response to which this property is attached.

System_CAPS_pubpropertyStatusDescription

Gets or sets the description of the status code of the current HTTP response to which this property is attached.

System_CAPS_pubpropertySuppressEntityBody

Gets or sets a value that indicates whether the body of the message is ignored and an empty message is sent.

System_CAPS_pubpropertySuppressPreamble

Gets or sets whether the message preamble is suppressed.

NameDescription
System_CAPS_pubmethodEquals(Object^)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_pubmethodToString()

Returns a string that represents the current object.(Inherited from Object.)

NameDescription
System_CAPS_pubinterfaceSystem_CAPS_privmethodIMessageProperty::CreateCopy()

Creates a new copy of the current instance.

This is a general-purpose class that gives you direct access to the HTTP response information, which could be used for encapsulation of HTTP-specific information. One use of this class is to support services implemented in accordance with the Representational State Transfer (REST) architecture.

This class enables you to support the following scenarios:

  • Controls whether an entity body is transmitted.

  • Allows HTTP header (key, value) pairs to be set for each response.

  • Varies the status code and status description used for each response.

This class can be used by HttpTransportBindingElement and related classes.

This shows how to use create an instance of the HttpResponseProperty class and modify some of its members:

HttpResponseMessageProperty responseProperty =
	new HttpResponseMessageProperty();
responseProperty.StatusCode = HttpStatusCode.OK;
responseProperty.Headers.Add(
			     HttpResponseHeader.ContentType,
			     "text/html; charset=UTF-8");

Universal Windows Platform
Available since 8
.NET Framework
Available since 3.0
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 3.0
Windows Phone Silverlight
Available since 7.0

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

Return to top
Show: