HttpResponseMessageProperty クラス

定義

HTTP プロトコルを介した要求で使用できる追加情報にアクセスして応答するために、HTTP 応答へのアクセスを提供します。

public ref class HttpResponseMessageProperty sealed : System::ServiceModel::Channels::IMessageProperty
public ref class HttpResponseMessageProperty sealed : System::ServiceModel::Channels::IMergeEnabledMessageProperty, System::ServiceModel::Channels::IMessageProperty
public ref class HttpResponseMessageProperty sealed
public sealed class HttpResponseMessageProperty : System.ServiceModel.Channels.IMessageProperty
public sealed class HttpResponseMessageProperty : System.ServiceModel.Channels.IMergeEnabledMessageProperty, System.ServiceModel.Channels.IMessageProperty
public sealed class HttpResponseMessageProperty
type HttpResponseMessageProperty = class
    interface IMessageProperty
type HttpResponseMessageProperty = class
    interface IMessageProperty
    interface IMergeEnabledMessageProperty
type HttpResponseMessageProperty = class
Public NotInheritable Class HttpResponseMessageProperty
Implements IMessageProperty
Public NotInheritable Class HttpResponseMessageProperty
Implements IMergeEnabledMessageProperty, IMessageProperty
Public NotInheritable Class HttpResponseMessageProperty
継承
HttpResponseMessageProperty
実装
IMessageProperty System.ServiceModel.Channels.IMergeEnabledMessageProperty

ここでは、 HttpResponseProperty クラスのインスタンスを作成し、そのメンバーの一部を変更する方法を示します。

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

注釈

これは、HTTP 固有の情報のカプセル化に使用できる HTTP 応答情報への直接アクセスを提供する汎用クラスです。 このクラスの 1 つの用途は、Representational State Transfer (REST) アーキテクチャに従って実装されたサービスをサポートすることです。

このクラスを使用すると、次のシナリオをサポートできます。

  • エンティティ本体を送信するかどうかを制御します。

  • 応答ごとに HTTP ヘッダー (キー、値) のペアを設定できるようにします。

  • 各応答に使用される状態コードと状態の説明を異なります。

このクラスは、 HttpTransportBindingElement および関連するクラスで使用できます。

コンストラクター

名前 説明
HttpResponseMessageProperty()

HttpResponseMessageProperty クラスの新しいインスタンスを初期化します。

プロパティ

名前 説明
Headers

HTTP 応答から HTTP ヘッダーを取得します。

HttpResponseMessage

HTTP プロトコルを介した要求で使用できる追加情報にアクセスして応答するために、HTTP 応答へのアクセスを提供します。

Name

HttpResponseMessageProperty クラスに関連付けられているメッセージ プロパティの名前を取得します。

StatusCode

このプロパティがアタッチされている現在の HTTP 応答の状態コードを取得または設定します。

StatusDescription

このプロパティがアタッチされている現在の HTTP 応答の状態コードの説明を取得または設定します。

SuppressEntityBody

メッセージの本文が無視され、空のメッセージが送信されるかどうかを示す値を取得または設定します。

SuppressPreamble

メッセージ プリアンブルを抑制するかどうかを取得または設定します。

メソッド

名前 説明
Equals(Object)

指定したオブジェクトが現在のオブジェクトと等しいかどうかを判断します。

(継承元 Object)
GetHashCode()

既定のハッシュ関数として機能します。

(継承元 Object)
GetType()

現在のインスタンスの Type を取得します。

(継承元 Object)
MemberwiseClone()

現在の Objectの簡易コピーを作成します。

(継承元 Object)
ToString()

現在のオブジェクトを表す文字列を返します。

(継承元 Object)

明示的なインターフェイスの実装

名前 説明
IMergeEnabledMessageProperty.TryMergeWithProperty(Object)

HTTP プロトコルを介した要求で使用できる追加情報にアクセスして応答するために、HTTP 応答へのアクセスを提供します。

IMessageProperty.CreateCopy()

現在のインスタンスの新しいコピーを作成します。

適用対象