HttpListenerResponse.ContentType プロパティ

定義

返されるコンテンツの MIME の種類を取得または設定します。

public:
 property System::String ^ ContentType { System::String ^ get(); void set(System::String ^ value); };
public string? ContentType { get; set; }
public string ContentType { get; set; }
member this.ContentType : string with get, set
Public Property ContentType As String

プロパティ値

String

応答の Content-Type ヘッダーのテキストを格納している String インスタンス。

例外

設定操作に指定された値は null です。

設定操作として指定した値が空の文字列 ("") です。

オブジェクトが閉じています。

注釈

Web ブラウザーと通信する場合は、次以外 text/htmlのコンテンツ タイプを返すときに、このプロパティを明示的に設定する必要があります。

応答ヘッダーの完全な一覧については、列挙型を HttpResponseHeader 参照してください。

適用対象

こちらもご覧ください